package interfaz;

import dominio.*;
import integracion.*;
import java.awt.Component;
import java.awt.event.ActionListener;
import java.io.IOException;
import java.sql.Date;
import java.sql.SQLException;
import java.sql.Time;
//import java.util.Calendar;
import java.util.Iterator;
import java.util.List;
import java.util.Vector;
import java.util.logging.Level;
import java.util.logging.Logger;
import javax.swing.JOptionPane;
import javax.swing.table.DefaultTableModel;


public class Insumo_Inventarios extends javax.swing.JFrame {

    ControlCategoria control_categoria;
    ActionListener v;
    ControlInsumo control_insumo;
    ControlEvento control_evento;
    ControlUso control_uso;
    ControlInventario control_inventario;
    ControlInsumoInventario control_InsumoInventario;
    private Component aviso;

    public Insumo_Inventarios() {
        initComponents();
        this.setLocation(210, 10);
    }

    @SuppressWarnings("unchecked")
    // <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents
    private void initComponents() {

        buttonGroup1 = new javax.swing.ButtonGroup();
        salir = new javax.swing.JButton();
        PanelGeneral = new javax.swing.JTabbedPane();
        jPanel3 = new javax.swing.JPanel();
        jPanel9 = new javax.swing.JPanel();
        jScrollPane2 = new javax.swing.JScrollPane();
        Tabla_Categorias = new javax.swing.JTable();
        Mostrar_Categorias = new javax.swing.JButton();
        jPanel13 = new javax.swing.JPanel();
        jLabel21 = new javax.swing.JLabel();
        jLabel22 = new javax.swing.JLabel();
        jLabel23 = new javax.swing.JLabel();
        NombreCategoria = new javax.swing.JTextField();
        InsertarCategoria = new javax.swing.JButton();
        jButton5 = new javax.swing.JButton();
        jPanel21 = new javax.swing.JPanel();
        jLabel46 = new javax.swing.JLabel();
        jLabel47 = new javax.swing.JLabel();
        jLabel48 = new javax.swing.JLabel();
        NombreCategoria2 = new javax.swing.JLabel();
        eliminarCategoria = new javax.swing.JButton();
        idCategoria = new javax.swing.JLabel();
        jPanel16 = new javax.swing.JPanel();
        jLabel27 = new javax.swing.JLabel();
        jLabel28 = new javax.swing.JLabel();
        jLabel29 = new javax.swing.JLabel();
        jLabel30 = new javax.swing.JLabel();
        NombreCategoria3 = new javax.swing.JTextField();
        CheckNombreCategoria = new javax.swing.JCheckBox();
        ModificarCategoria = new javax.swing.JButton();
        idCategoria1 = new javax.swing.JLabel();
        jPanel2 = new javax.swing.JPanel();
        jPanel10 = new javax.swing.JPanel();
        jScrollPane3 = new javax.swing.JScrollPane();
        Tabla_Insumos = new javax.swing.JTable();
        Mostrar_Insumos = new javax.swing.JButton();
        jPanel11 = new javax.swing.JPanel();
        jLabel8 = new javax.swing.JLabel();
        jLabel18 = new javax.swing.JLabel();
        jLabel9 = new javax.swing.JLabel();
        NombreInsumo = new javax.swing.JTextField();
        InsertarInsumo = new javax.swing.JButton();
        jButton3 = new javax.swing.JButton();
        jLabel35 = new javax.swing.JLabel();
        Categorias = new javax.swing.JComboBox();
        jLabel24 = new javax.swing.JLabel();
        CantidadInsumo = new javax.swing.JTextField();
        jLabel25 = new javax.swing.JLabel();
        CostoInsumo = new javax.swing.JTextField();
        jPanel12 = new javax.swing.JPanel();
        jLabel10 = new javax.swing.JLabel();
        jLabel11 = new javax.swing.JLabel();
        jLabel12 = new javax.swing.JLabel();
        NombreInsumo2 = new javax.swing.JLabel();
        EliminarInsumo = new javax.swing.JButton();
        idInsumo = new javax.swing.JLabel();
        jPanel15 = new javax.swing.JPanel();
        jLabel19 = new javax.swing.JLabel();
        jLabel20 = new javax.swing.JLabel();
        jLabel13 = new javax.swing.JLabel();
        jLabel14 = new javax.swing.JLabel();
        NombreInsumo3 = new javax.swing.JTextField();
        CheckNombreInsumo = new javax.swing.JCheckBox();
        ModificarInsumo = new javax.swing.JButton();
        jLabel15 = new javax.swing.JLabel();
        CantidadInsumoModificar = new javax.swing.JTextField();
        jLabel16 = new javax.swing.JLabel();
        CostoInsumoModificar = new javax.swing.JTextField();
        jLabel17 = new javax.swing.JLabel();
        CategoriaModificar = new javax.swing.JComboBox();
        CheckCantidadInsumo = new javax.swing.JCheckBox();
        CheckCostoInsumo = new javax.swing.JCheckBox();
        CheckCategoriaInsumo = new javax.swing.JCheckBox();
        idInsumo1 = new javax.swing.JLabel();
        jPanel5 = new javax.swing.JPanel();
        jPanel1 = new javax.swing.JPanel();
        MostrarInsumoUso = new javax.swing.JButton();
        jPanel8 = new javax.swing.JPanel();
        jLabel26 = new javax.swing.JLabel();
        jLabel31 = new javax.swing.JLabel();
        IdInsumoUso = new javax.swing.JLabel();
        ConceptoInsumoUso = new javax.swing.JLabel();
        jLabel32 = new javax.swing.JLabel();
        CategoriaInsumoUso = new javax.swing.JLabel();
        diaInsumo = new javax.swing.JComboBox();
        mesInsumo = new com.toedter.calendar.JMonthChooser();
        anoInsumo = new com.toedter.calendar.JYearChooser();
        jLabel33 = new javax.swing.JLabel();
        jScrollPane5 = new javax.swing.JScrollPane();
        TablaInsumoUso = new javax.swing.JTable();
        jPanel6 = new javax.swing.JPanel();
        jPanel7 = new javax.swing.JPanel();
        jLabel3 = new javax.swing.JLabel();
        jLabel4 = new javax.swing.JLabel();
        IdInsumoDisponible = new javax.swing.JLabel();
        ConceptoInsumoDisponible = new javax.swing.JLabel();
        jLabel7 = new javax.swing.JLabel();
        CategoriaInsumoDisponible = new javax.swing.JLabel();
        diaInsumo1 = new javax.swing.JComboBox();
        jLabel1 = new javax.swing.JLabel();
        mesInsumo1 = new com.toedter.calendar.JMonthChooser();
        anoInsumo1 = new com.toedter.calendar.JYearChooser();
        jScrollPane4 = new javax.swing.JScrollPane();
        TablaInsumoDisponible = new javax.swing.JTable();
        MostrarInsumoDisponible = new javax.swing.JButton();
        jPanel4 = new javax.swing.JPanel();
        jPanel14 = new javax.swing.JPanel();
        jLabel2 = new javax.swing.JLabel();
        jLabel5 = new javax.swing.JLabel();
        jLabel6 = new javax.swing.JLabel();
        jLabel34 = new javax.swing.JLabel();
        EventoConsulta = new javax.swing.JComboBox();
        HoraIConsulta = new javax.swing.JLabel();
        HoraFConsulta = new javax.swing.JLabel();
        FechaEventoConsulta = new javax.swing.JLabel();
        jLabel37 = new javax.swing.JLabel();
        jLabel38 = new javax.swing.JLabel();
        jLabel39 = new javax.swing.JLabel();
        PanelInsumoEvento = new javax.swing.JPanel();
        jScrollPane1 = new javax.swing.JScrollPane();
        TablaEventoInsumo = new javax.swing.JTable();
        CategoriaInsumoEvento = new javax.swing.JComboBox();
        jLabel36 = new javax.swing.JLabel();
        Consultar = new javax.swing.JButton();
        jMenuBar1 = new javax.swing.JMenuBar();
        archivo = new javax.swing.JMenu();
        nuevaCotizacion = new javax.swing.JMenuItem();
        informacionSistema = new javax.swing.JMenuItem();
        jMenuItem2 = new javax.swing.JMenuItem();
        jSeparator1 = new javax.swing.JSeparator();
        exit = new javax.swing.JMenuItem();
        jMenu1 = new javax.swing.JMenu();
        acercaDe = new javax.swing.JMenuItem();

        setDefaultCloseOperation(javax.swing.WindowConstants.DISPOSE_ON_CLOSE);
        setTitle("Informacion del sistema");
        setResizable(false);

        salir.setIcon(new javax.swing.ImageIcon(getClass().getResource("/Iconos/exit.png"))); // NOI18N
        salir.setText("Salir");
        salir.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                salirActionPerformed(evt);
            }
        });

        PanelGeneral.setBackground(javax.swing.UIManager.getDefaults().getColor("Button.light"));

        jPanel9.setBorder(javax.swing.BorderFactory.createEtchedBorder());

        Tabla_Categorias.setModel(new javax.swing.table.DefaultTableModel(
            new Object [][] {

            },
            new String [] {
                "Id", "nombre"
            }
        ));
        Tabla_Categorias.addMouseListener(new java.awt.event.MouseAdapter() {
            public void mouseClicked(java.awt.event.MouseEvent evt) {
                Tabla_CategoriasMouseClicked(evt);
            }
        });
        jScrollPane2.setViewportView(Tabla_Categorias);

        Mostrar_Categorias.setText("Mostrar");
        Mostrar_Categorias.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                Mostrar_CategoriasActionPerformed(evt);
            }
        });

        org.jdesktop.layout.GroupLayout jPanel9Layout = new org.jdesktop.layout.GroupLayout(jPanel9);
        jPanel9.setLayout(jPanel9Layout);
        jPanel9Layout.setHorizontalGroup(
            jPanel9Layout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING)
            .add(jPanel9Layout.createSequentialGroup()
                .addContainerGap()
                .add(jScrollPane2, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, 825, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE)
                .addContainerGap(org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
            .add(org.jdesktop.layout.GroupLayout.TRAILING, jPanel9Layout.createSequentialGroup()
                .addContainerGap(766, Short.MAX_VALUE)
                .add(Mostrar_Categorias)
                .addContainerGap())
        );
        jPanel9Layout.setVerticalGroup(
            jPanel9Layout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING)
            .add(jPanel9Layout.createSequentialGroup()
                .addContainerGap(org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                .add(jScrollPane2, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, 246, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE)
                .add(15, 15, 15)
                .add(Mostrar_Categorias)
                .addContainerGap())
        );

        jPanel13.setBorder(javax.swing.BorderFactory.createTitledBorder("Insertar Categoria"));

        jLabel21.setIcon(new javax.swing.ImageIcon(getClass().getResource("/Iconos/edit_add.png"))); // NOI18N

        jLabel22.setFont(new java.awt.Font("Tahoma", 0, 10));
        jLabel22.setForeground(new java.awt.Color(255, 0, 0));
        jLabel22.setText("Campos obligatorios (*)");

        jLabel23.setText("(*)Nombre: ");
        jLabel23.setMaximumSize(new java.awt.Dimension(54, 14));
        jLabel23.setMinimumSize(new java.awt.Dimension(54, 14));

        NombreCategoria.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                NombreCategoriaActionPerformed(evt);
            }
        });

        InsertarCategoria.setText("Insertar");
        InsertarCategoria.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                InsertarCategoriaActionPerformed(evt);
            }
        });

        jButton5.setText("Limpiar");

        org.jdesktop.layout.GroupLayout jPanel13Layout = new org.jdesktop.layout.GroupLayout(jPanel13);
        jPanel13.setLayout(jPanel13Layout);
        jPanel13Layout.setHorizontalGroup(
            jPanel13Layout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING)
            .add(jPanel13Layout.createSequentialGroup()
                .add(jPanel13Layout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING)
                    .add(jPanel13Layout.createSequentialGroup()
                        .add(6, 6, 6)
                        .add(jLabel21)
                        .addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED)
                        .add(jLabel22))
                    .add(jPanel13Layout.createSequentialGroup()
                        .add(23, 23, 23)
                        .add(jLabel23, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE)
                        .addPreferredGap(org.jdesktop.layout.LayoutStyle.UNRELATED)
                        .add(NombreCategoria, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, 127, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE))
                    .add(org.jdesktop.layout.GroupLayout.TRAILING, jPanel13Layout.createSequentialGroup()
                        .add(91, 91, 91)
                        .add(jButton5)
                        .add(18, 18, 18)
                        .add(InsertarCategoria, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)))
                .addContainerGap())
        );
        jPanel13Layout.setVerticalGroup(
            jPanel13Layout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING)
            .add(jPanel13Layout.createSequentialGroup()
                .add(jPanel13Layout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING)
                    .add(jLabel21)
                    .add(jLabel22))
                .add(18, 18, 18)
                .add(jPanel13Layout.createParallelGroup(org.jdesktop.layout.GroupLayout.BASELINE)
                    .add(jLabel23, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE)
                    .add(NombreCategoria, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE))
                .add(140, 140, 140)
                .add(jPanel13Layout.createParallelGroup(org.jdesktop.layout.GroupLayout.BASELINE)
                    .add(InsertarCategoria, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                    .add(jButton5))
                .addContainerGap())
        );

        jPanel21.setBorder(javax.swing.BorderFactory.createTitledBorder("Eliminar Categoria"));

        jLabel46.setIcon(new javax.swing.ImageIcon(getClass().getResource("/Iconos/edit_remove.png"))); // NOI18N

        jLabel47.setText("Id:");

        jLabel48.setText("Nombre:");

        NombreCategoria2.setText("NombreCategoria");

        eliminarCategoria.setText("Eliminar");
        eliminarCategoria.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                eliminarCategoria1ActionPerformed(evt);
            }
        });

        idCategoria.setText("             ");

        org.jdesktop.layout.GroupLayout jPanel21Layout = new org.jdesktop.layout.GroupLayout(jPanel21);
        jPanel21.setLayout(jPanel21Layout);
        jPanel21Layout.setHorizontalGroup(
            jPanel21Layout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING)
            .add(jPanel21Layout.createSequentialGroup()
                .addContainerGap()
                .add(jPanel21Layout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING)
                    .add(jLabel46)
                    .add(jPanel21Layout.createSequentialGroup()
                        .add(jPanel21Layout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING)
                            .add(jLabel48)
                            .add(jLabel47))
                        .addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED)
                        .add(jPanel21Layout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING)
                            .add(idCategoria)
                            .add(NombreCategoria2, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, 151, Short.MAX_VALUE))))
                .addContainerGap(51, Short.MAX_VALUE))
            .add(org.jdesktop.layout.GroupLayout.TRAILING, jPanel21Layout.createSequentialGroup()
                .add(180, 180, 180)
                .add(eliminarCategoria, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                .addContainerGap())
        );
        jPanel21Layout.setVerticalGroup(
            jPanel21Layout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING)
            .add(jPanel21Layout.createSequentialGroup()
                .add(jLabel46)
                .add(18, 18, 18)
                .add(jPanel21Layout.createParallelGroup(org.jdesktop.layout.GroupLayout.BASELINE)
                    .add(jLabel47)
                    .add(idCategoria, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, 14, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE))
                .add(18, 18, 18)
                .add(jPanel21Layout.createParallelGroup(org.jdesktop.layout.GroupLayout.BASELINE)
                    .add(jLabel48)
                    .add(NombreCategoria2))
                .addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED, 117, Short.MAX_VALUE)
                .add(eliminarCategoria)
                .addContainerGap())
        );

        jPanel16.setBorder(javax.swing.BorderFactory.createTitledBorder("Modificar Categoria"));

        jLabel27.setIcon(new javax.swing.ImageIcon(getClass().getResource("/Iconos/configure.png"))); // NOI18N

        jLabel28.setFont(new java.awt.Font("Tahoma", 0, 10));
        jLabel28.setText("Seleccione los campos que desea modificar");

        jLabel29.setText("Id:");

        jLabel30.setText("Nombre:");

        NombreCategoria3.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                NombreCategoria3ActionPerformed(evt);
            }
        });

        CheckNombreCategoria.setText("jCheckBox1");
        CheckNombreCategoria.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                CheckNombreCategoriaActionPerformed(evt);
            }
        });

        ModificarCategoria.setText("Modificar");
        ModificarCategoria.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                ModificarCategoriaActionPerformed(evt);
            }
        });

        idCategoria1.setText("             ");

        org.jdesktop.layout.GroupLayout jPanel16Layout = new org.jdesktop.layout.GroupLayout(jPanel16);
        jPanel16.setLayout(jPanel16Layout);
        jPanel16Layout.setHorizontalGroup(
            jPanel16Layout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING)
            .add(jPanel16Layout.createSequentialGroup()
                .addContainerGap()
                .add(jPanel16Layout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING)
                    .add(org.jdesktop.layout.GroupLayout.TRAILING, ModificarCategoria)
                    .add(jPanel16Layout.createSequentialGroup()
                        .add(jPanel16Layout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING)
                            .add(jLabel27)
                            .add(jLabel30)
                            .add(jLabel29))
                        .add(6, 6, 6)
                        .add(jPanel16Layout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING)
                            .add(jPanel16Layout.createSequentialGroup()
                                .addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED)
                                .add(NombreCategoria3, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, 137, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE)
                                .addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED)
                                .add(CheckNombreCategoria, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, 21, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE))
                            .add(idCategoria1)
                            .add(jLabel28, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))))
                .addContainerGap())
        );
        jPanel16Layout.setVerticalGroup(
            jPanel16Layout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING)
            .add(jPanel16Layout.createSequentialGroup()
                .add(jPanel16Layout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING)
                    .add(jLabel27)
                    .add(jLabel28))
                .add(20, 20, 20)
                .add(jPanel16Layout.createParallelGroup(org.jdesktop.layout.GroupLayout.BASELINE)
                    .add(jLabel29)
                    .add(idCategoria1))
                .add(18, 18, 18)
                .add(jPanel16Layout.createParallelGroup(org.jdesktop.layout.GroupLayout.BASELINE)
                    .add(NombreCategoria3, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE)
                    .add(CheckNombreCategoria)
                    .add(jLabel30))
                .addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED, 106, Short.MAX_VALUE)
                .add(ModificarCategoria)
                .addContainerGap())
        );

        org.jdesktop.layout.GroupLayout jPanel3Layout = new org.jdesktop.layout.GroupLayout(jPanel3);
        jPanel3.setLayout(jPanel3Layout);
        jPanel3Layout.setHorizontalGroup(
            jPanel3Layout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING)
            .add(jPanel3Layout.createSequentialGroup()
                .addContainerGap()
                .add(jPanel3Layout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING, false)
                    .add(jPanel3Layout.createSequentialGroup()
                        .add(jPanel9, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE)
                        .add(11, 11, 11))
                    .add(jPanel3Layout.createSequentialGroup()
                        .add(jPanel13, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE)
                        .add(18, 18, 18)
                        .add(jPanel21, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE)
                        .addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                        .add(jPanel16, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE)
                        .addContainerGap())))
        );
        jPanel3Layout.setVerticalGroup(
            jPanel3Layout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING)
            .add(jPanel3Layout.createSequentialGroup()
                .addContainerGap()
                .add(jPanel9, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE)
                .addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED)
                .add(jPanel3Layout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING)
                    .add(jPanel3Layout.createParallelGroup(org.jdesktop.layout.GroupLayout.TRAILING, false)
                        .add(org.jdesktop.layout.GroupLayout.LEADING, jPanel21, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                        .add(org.jdesktop.layout.GroupLayout.LEADING, jPanel16, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
                    .add(jPanel13, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE))
                .add(49, 49, 49))
        );

        PanelGeneral.addTab("Categorias", jPanel3);

        jPanel10.setBorder(javax.swing.BorderFactory.createEtchedBorder());

        Tabla_Insumos.setModel(new javax.swing.table.DefaultTableModel(
            new Object [][] {

            },
            new String [] {
                "Id", "Nombre", "Categoria"
            }
        ));
        Tabla_Insumos.addMouseListener(new java.awt.event.MouseAdapter() {
            public void mouseClicked(java.awt.event.MouseEvent evt) {
                Tabla_InsumosMouseClicked(evt);
            }
        });
        jScrollPane3.setViewportView(Tabla_Insumos);

        Mostrar_Insumos.setText("Mostrar");
        Mostrar_Insumos.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                Mostrar_InsumosActionPerformed(evt);
            }
        });

        org.jdesktop.layout.GroupLayout jPanel10Layout = new org.jdesktop.layout.GroupLayout(jPanel10);
        jPanel10.setLayout(jPanel10Layout);
        jPanel10Layout.setHorizontalGroup(
            jPanel10Layout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING)
            .add(jPanel10Layout.createSequentialGroup()
                .addContainerGap()
                .add(jPanel10Layout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING)
                    .add(jScrollPane3, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, 827, Short.MAX_VALUE)
                    .add(org.jdesktop.layout.GroupLayout.TRAILING, Mostrar_Insumos))
                .addContainerGap())
        );
        jPanel10Layout.setVerticalGroup(
            jPanel10Layout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING)
            .add(jPanel10Layout.createSequentialGroup()
                .addContainerGap()
                .add(jScrollPane3, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, 224, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE)
                .add(18, 18, 18)
                .add(Mostrar_Insumos)
                .addContainerGap(org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
        );

        jPanel11.setBorder(javax.swing.BorderFactory.createTitledBorder("Insertar Insumo"));

        jLabel8.setIcon(new javax.swing.ImageIcon(getClass().getResource("/Iconos/edit_add.png"))); // NOI18N

        jLabel18.setFont(new java.awt.Font("Tahoma", 0, 10));
        jLabel18.setForeground(new java.awt.Color(255, 0, 0));
        jLabel18.setText("Campos obligatorios (*)");

        jLabel9.setText("(*)Nombre: ");
        jLabel9.setMaximumSize(new java.awt.Dimension(54, 14));
        jLabel9.setMinimumSize(new java.awt.Dimension(54, 14));

        NombreInsumo.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                NombreInsumoActionPerformed(evt);
            }
        });

        InsertarInsumo.setText("Insertar");
        InsertarInsumo.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                InsertarInsumoActionPerformed(evt);
            }
        });

        jButton3.setText("Limpiar");

        jLabel35.setText("(*)Categoria:");

        Categorias.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                CategoriasActionPerformed(evt);
            }
        });

        jLabel24.setText("(*)Cantidad:");

        CantidadInsumo.setText("0");

        jLabel25.setText("(*)Costo Unitario:");

        CostoInsumo.setText("0");

        org.jdesktop.layout.GroupLayout jPanel11Layout = new org.jdesktop.layout.GroupLayout(jPanel11);
        jPanel11.setLayout(jPanel11Layout);
        jPanel11Layout.setHorizontalGroup(
            jPanel11Layout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING)
            .add(jPanel11Layout.createSequentialGroup()
                .add(39, 39, 39)
                .add(jLabel8)
                .addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED)
                .add(jLabel18)
                .addContainerGap(78, Short.MAX_VALUE))
            .add(jPanel11Layout.createSequentialGroup()
                .addContainerGap()
                .add(jPanel11Layout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING)
                    .add(jLabel25)
                    .add(jLabel24)
                    .add(jLabel35)
                    .add(jLabel9, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE))
                .addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED)
                .add(jPanel11Layout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING, false)
                    .add(CostoInsumo)
                    .add(NombreInsumo, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, 127, Short.MAX_VALUE)
                    .add(CantidadInsumo, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, 126, Short.MAX_VALUE)
                    .add(Categorias, 0, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
                .addContainerGap(26, Short.MAX_VALUE))
            .add(org.jdesktop.layout.GroupLayout.TRAILING, jPanel11Layout.createSequentialGroup()
                .addContainerGap(89, Short.MAX_VALUE)
                .add(jButton3)
                .add(18, 18, 18)
                .add(InsertarInsumo)
                .addContainerGap())
        );
        jPanel11Layout.setVerticalGroup(
            jPanel11Layout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING)
            .add(jPanel11Layout.createSequentialGroup()
                .add(jPanel11Layout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING)
                    .add(jLabel8)
                    .add(jLabel18))
                .add(18, 18, 18)
                .add(jPanel11Layout.createParallelGroup(org.jdesktop.layout.GroupLayout.BASELINE)
                    .add(NombreInsumo, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE)
                    .add(jLabel9, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE))
                .addPreferredGap(org.jdesktop.layout.LayoutStyle.UNRELATED)
                .add(jPanel11Layout.createParallelGroup(org.jdesktop.layout.GroupLayout.BASELINE)
                    .add(Categorias, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE)
                    .add(jLabel35))
                .addPreferredGap(org.jdesktop.layout.LayoutStyle.UNRELATED)
                .add(jPanel11Layout.createParallelGroup(org.jdesktop.layout.GroupLayout.BASELINE)
                    .add(CantidadInsumo, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE)
                    .add(jLabel24))
                .addPreferredGap(org.jdesktop.layout.LayoutStyle.UNRELATED)
                .add(jPanel11Layout.createParallelGroup(org.jdesktop.layout.GroupLayout.BASELINE)
                    .add(jLabel25)
                    .add(CostoInsumo, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE))
                .addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED, 48, Short.MAX_VALUE)
                .add(jPanel11Layout.createParallelGroup(org.jdesktop.layout.GroupLayout.BASELINE)
                    .add(InsertarInsumo)
                    .add(jButton3))
                .addContainerGap())
        );

        jPanel12.setBorder(javax.swing.BorderFactory.createTitledBorder("Eliminar Insumo"));

        jLabel10.setIcon(new javax.swing.ImageIcon(getClass().getResource("/Iconos/edit_remove.png"))); // NOI18N

        jLabel11.setText("Id:");

        jLabel12.setText("Nombre:");

        NombreInsumo2.setText("NombreInsumo");

        EliminarInsumo.setText("Eliminar");
        EliminarInsumo.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                EliminarInsumoActionPerformed(evt);
            }
        });

        idInsumo.setText("             ");

        org.jdesktop.layout.GroupLayout jPanel12Layout = new org.jdesktop.layout.GroupLayout(jPanel12);
        jPanel12.setLayout(jPanel12Layout);
        jPanel12Layout.setHorizontalGroup(
            jPanel12Layout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING)
            .add(jPanel12Layout.createSequentialGroup()
                .addContainerGap()
                .add(jPanel12Layout.createParallelGroup(org.jdesktop.layout.GroupLayout.TRAILING)
                    .add(org.jdesktop.layout.GroupLayout.LEADING, jLabel10)
                    .add(org.jdesktop.layout.GroupLayout.LEADING, jPanel12Layout.createSequentialGroup()
                        .add(jPanel12Layout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING)
                            .add(jLabel12)
                            .add(jLabel11))
                        .addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED)
                        .add(jPanel12Layout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING)
                            .add(idInsumo)
                            .add(NombreInsumo2, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, 212, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE))))
                .addContainerGap(org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
            .add(org.jdesktop.layout.GroupLayout.TRAILING, jPanel12Layout.createSequentialGroup()
                .addContainerGap(165, Short.MAX_VALUE)
                .add(EliminarInsumo)
                .add(45, 45, 45))
        );
        jPanel12Layout.setVerticalGroup(
            jPanel12Layout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING)
            .add(jPanel12Layout.createSequentialGroup()
                .add(jLabel10)
                .add(18, 18, 18)
                .add(jPanel12Layout.createParallelGroup(org.jdesktop.layout.GroupLayout.BASELINE)
                    .add(jLabel11, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, 17, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE)
                    .add(idInsumo))
                .addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED)
                .add(jPanel12Layout.createParallelGroup(org.jdesktop.layout.GroupLayout.BASELINE)
                    .add(jLabel12)
                    .add(NombreInsumo2))
                .add(124, 124, 124)
                .add(EliminarInsumo)
                .addContainerGap())
        );

        jPanel15.setBorder(javax.swing.BorderFactory.createTitledBorder("Modificar Insumo"));

        jLabel19.setIcon(new javax.swing.ImageIcon(getClass().getResource("/Iconos/configure.png"))); // NOI18N

        jLabel20.setFont(new java.awt.Font("Tahoma", 0, 10));
        jLabel20.setText("Seleccione los campos que desea modificar");

        jLabel13.setText("Id:");

        jLabel14.setText("Nombre:");

        NombreInsumo3.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                NombreInsumo3ActionPerformed(evt);
            }
        });

        CheckNombreInsumo.setText("jCheckBox1");
        CheckNombreInsumo.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                CheckNombreInsumoActionPerformed(evt);
            }
        });

        ModificarInsumo.setText("Modificar");
        ModificarInsumo.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                ModificarInsumoActionPerformed(evt);
            }
        });

        jLabel15.setText("Cantidad");

        jLabel16.setText("Costo Unitario");

        jLabel17.setText("Categoria:");

        CategoriaModificar.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                CategoriaModificarActionPerformed(evt);
            }
        });

        CheckCantidadInsumo.setText("jCheckBox1");
        CheckCantidadInsumo.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                CheckCantidadInsumoActionPerformed(evt);
            }
        });

        CheckCostoInsumo.setText("jCheckBox2");
        CheckCostoInsumo.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                CheckCostoInsumoActionPerformed(evt);
            }
        });

        CheckCategoriaInsumo.setText("jCheckBox3");
        CheckCategoriaInsumo.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                CheckCategoriaInsumoActionPerformed(evt);
            }
        });

        idInsumo1.setText("             ");

        org.jdesktop.layout.GroupLayout jPanel15Layout = new org.jdesktop.layout.GroupLayout(jPanel15);
        jPanel15.setLayout(jPanel15Layout);
        jPanel15Layout.setHorizontalGroup(
            jPanel15Layout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING)
            .add(jPanel15Layout.createSequentialGroup()
                .addContainerGap()
                .add(jPanel15Layout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING)
                    .add(jPanel15Layout.createSequentialGroup()
                        .add(jPanel15Layout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING)
                            .add(jPanel15Layout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING)
                                .add(jPanel15Layout.createSequentialGroup()
                                    .add(19, 19, 19)
                                    .add(jLabel19))
                                .add(org.jdesktop.layout.GroupLayout.TRAILING, jLabel16))
                            .add(jLabel13)
                            .add(jLabel14)
                            .add(jLabel15)
                            .add(jLabel17))
                        .addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED)
                        .add(jPanel15Layout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING)
                            .add(jPanel15Layout.createSequentialGroup()
                                .add(jPanel15Layout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING)
                                    .add(jLabel20, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, 214, Short.MAX_VALUE)
                                    .add(jPanel15Layout.createSequentialGroup()
                                        .add(10, 10, 10)
                                        .add(jPanel15Layout.createParallelGroup(org.jdesktop.layout.GroupLayout.TRAILING, false)
                                            .add(org.jdesktop.layout.GroupLayout.LEADING, CantidadInsumoModificar)
                                            .add(org.jdesktop.layout.GroupLayout.LEADING, CostoInsumoModificar)
                                            .add(org.jdesktop.layout.GroupLayout.LEADING, CategoriaModificar, 0, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                                            .add(org.jdesktop.layout.GroupLayout.LEADING, NombreInsumo3, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, 149, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE))
                                        .addPreferredGap(org.jdesktop.layout.LayoutStyle.UNRELATED)
                                        .add(jPanel15Layout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING)
                                            .add(CheckCantidadInsumo, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, 19, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE)
                                            .add(CheckNombreInsumo, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, 21, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE)
                                            .add(CheckCategoriaInsumo, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, 21, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE)
                                            .add(CheckCostoInsumo, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, 20, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE))))
                                .add(10, 10, 10))
                            .add(jPanel15Layout.createSequentialGroup()
                                .add(idInsumo1)
                                .addContainerGap())))
                    .add(org.jdesktop.layout.GroupLayout.TRAILING, jPanel15Layout.createSequentialGroup()
                        .add(ModificarInsumo)
                        .addContainerGap())))
        );
        jPanel15Layout.setVerticalGroup(
            jPanel15Layout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING)
            .add(jPanel15Layout.createSequentialGroup()
                .add(jPanel15Layout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING)
                    .add(jLabel19)
                    .add(jLabel20))
                .add(21, 21, 21)
                .add(jPanel15Layout.createParallelGroup(org.jdesktop.layout.GroupLayout.TRAILING)
                    .add(jLabel13)
                    .add(idInsumo1))
                .addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED)
                .add(jPanel15Layout.createParallelGroup(org.jdesktop.layout.GroupLayout.BASELINE)
                    .add(NombreInsumo3, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE)
                    .add(CheckNombreInsumo)
                    .add(jLabel14))
                .addPreferredGap(org.jdesktop.layout.LayoutStyle.UNRELATED)
                .add(jPanel15Layout.createParallelGroup(org.jdesktop.layout.GroupLayout.BASELINE)
                    .add(CantidadInsumoModificar, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE)
                    .add(CheckCantidadInsumo)
                    .add(jLabel15))
                .add(18, 18, 18)
                .add(jPanel15Layout.createParallelGroup(org.jdesktop.layout.GroupLayout.BASELINE)
                    .add(jLabel16)
                    .add(CostoInsumoModificar, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE)
                    .add(CheckCostoInsumo))
                .add(18, 18, 18)
                .add(jPanel15Layout.createParallelGroup(org.jdesktop.layout.GroupLayout.BASELINE)
                    .add(CategoriaModificar, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE)
                    .add(CheckCategoriaInsumo)
                    .add(jLabel17))
                .addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED, 6, Short.MAX_VALUE)
                .add(ModificarInsumo)
                .addContainerGap())
        );

        org.jdesktop.layout.GroupLayout jPanel2Layout = new org.jdesktop.layout.GroupLayout(jPanel2);
        jPanel2.setLayout(jPanel2Layout);
        jPanel2Layout.setHorizontalGroup(
            jPanel2Layout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING)
            .add(jPanel2Layout.createSequentialGroup()
                .addContainerGap()
                .add(jPanel2Layout.createParallelGroup(org.jdesktop.layout.GroupLayout.TRAILING, false)
                    .add(org.jdesktop.layout.GroupLayout.LEADING, jPanel10, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                    .add(org.jdesktop.layout.GroupLayout.LEADING, jPanel2Layout.createSequentialGroup()
                        .add(jPanel11, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE)
                        .add(2, 2, 2)
                        .add(jPanel12, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, 254, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE)
                        .addPreferredGap(org.jdesktop.layout.LayoutStyle.UNRELATED)
                        .add(jPanel15, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE)))
                .addContainerGap(21, Short.MAX_VALUE))
        );
        jPanel2Layout.setVerticalGroup(
            jPanel2Layout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING)
            .add(jPanel2Layout.createSequentialGroup()
                .addContainerGap()
                .add(jPanel10, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE)
                .add(18, 18, 18)
                .add(jPanel2Layout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING)
                    .add(jPanel2Layout.createParallelGroup(org.jdesktop.layout.GroupLayout.TRAILING, false)
                        .add(org.jdesktop.layout.GroupLayout.LEADING, jPanel11, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                        .add(org.jdesktop.layout.GroupLayout.LEADING, jPanel12, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
                    .add(jPanel15, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE))
                .addContainerGap(13, Short.MAX_VALUE))
        );

        PanelGeneral.addTab("Insumos", jPanel2);

        jPanel1.setBorder(javax.swing.BorderFactory.createEtchedBorder());

        MostrarInsumoUso.setText("Mostrar");
        MostrarInsumoUso.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                MostrarInsumoUsoActionPerformed(evt);
            }
        });

        jPanel8.setBorder(javax.swing.BorderFactory.createTitledBorder("Informacion Insumos En Uso"));

        jLabel26.setText("Id:");

        jLabel31.setText("Concepto:");

        IdInsumoUso.setText("           ");

        ConceptoInsumoUso.setText("           ");

        jLabel32.setText("Categoria:");

        CategoriaInsumoUso.setText("           ");

        diaInsumo.setModel(new javax.swing.DefaultComboBoxModel(new String[] { "01", "02", "03", "04", "05", "06", "07", "08", "09", "10", "11", "12", "13", "14", "15", "16", "17", "18", "19", "20", "21", "22", "23", "24", "25", "26", "27", "28", "29", "30", "31" }));
        diaInsumo.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                diaInsumoActionPerformed(evt);
            }
        });

        mesInsumo.setFont(new java.awt.Font("Tahoma", 0, 11));

        jLabel33.setText("Fecha:");

        org.jdesktop.layout.GroupLayout jPanel8Layout = new org.jdesktop.layout.GroupLayout(jPanel8);
        jPanel8.setLayout(jPanel8Layout);
        jPanel8Layout.setHorizontalGroup(
            jPanel8Layout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING)
            .add(jPanel8Layout.createSequentialGroup()
                .add(19, 19, 19)
                .add(jPanel8Layout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING)
                    .add(jPanel8Layout.createSequentialGroup()
                        .add(jPanel8Layout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING)
                            .add(jLabel32)
                            .add(jLabel31)
                            .add(jLabel26))
                        .addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED)
                        .add(jPanel8Layout.createParallelGroup(org.jdesktop.layout.GroupLayout.TRAILING)
                            .add(ConceptoInsumoUso)
                            .add(IdInsumoUso)
                            .add(CategoriaInsumoUso)))
                    .add(jPanel8Layout.createSequentialGroup()
                        .add(jLabel33)
                        .addPreferredGap(org.jdesktop.layout.LayoutStyle.UNRELATED)
                        .add(diaInsumo, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE)
                        .addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED)
                        .add(mesInsumo, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                        .addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED)
                        .add(anoInsumo, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE)))
                .addContainerGap())
        );
        jPanel8Layout.setVerticalGroup(
            jPanel8Layout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING)
            .add(jPanel8Layout.createSequentialGroup()
                .add(20, 20, 20)
                .add(jPanel8Layout.createParallelGroup(org.jdesktop.layout.GroupLayout.TRAILING)
                    .add(anoInsumo, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE)
                    .add(jPanel8Layout.createSequentialGroup()
                        .add(jPanel8Layout.createParallelGroup(org.jdesktop.layout.GroupLayout.BASELINE)
                            .add(IdInsumoUso)
                            .add(jLabel26))
                        .add(18, 18, 18)
                        .add(jPanel8Layout.createParallelGroup(org.jdesktop.layout.GroupLayout.BASELINE)
                            .add(ConceptoInsumoUso)
                            .add(jLabel31))
                        .addPreferredGap(org.jdesktop.layout.LayoutStyle.UNRELATED)
                        .add(jPanel8Layout.createParallelGroup(org.jdesktop.layout.GroupLayout.BASELINE)
                            .add(CategoriaInsumoUso)
                            .add(jLabel32))
                        .addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED)
                        .add(jPanel8Layout.createParallelGroup(org.jdesktop.layout.GroupLayout.TRAILING)
                            .add(mesInsumo, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE)
                            .add(jPanel8Layout.createParallelGroup(org.jdesktop.layout.GroupLayout.BASELINE)
                                .add(diaInsumo, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE)
                                .add(jLabel33)))))
                .addContainerGap(54, Short.MAX_VALUE))
        );

        TablaInsumoUso.setModel(new javax.swing.table.DefaultTableModel(
            new Object [][] {

            },
            new String [] {
                "Id_Insumo", "Concepto"
            }
        ));
        TablaInsumoUso.addMouseListener(new java.awt.event.MouseAdapter() {
            public void mouseClicked(java.awt.event.MouseEvent evt) {
                TablaInsumoUsoMouseClicked(evt);
            }
        });
        jScrollPane5.setViewportView(TablaInsumoUso);

        org.jdesktop.layout.GroupLayout jPanel1Layout = new org.jdesktop.layout.GroupLayout(jPanel1);
        jPanel1.setLayout(jPanel1Layout);
        jPanel1Layout.setHorizontalGroup(
            jPanel1Layout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING)
            .add(jPanel1Layout.createSequentialGroup()
                .addContainerGap()
                .add(jPanel1Layout.createParallelGroup(org.jdesktop.layout.GroupLayout.TRAILING)
                    .add(MostrarInsumoUso)
                    .add(jPanel1Layout.createSequentialGroup()
                        .add(jPanel8, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE)
                        .addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED)
                        .add(jScrollPane5, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, 491, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE)))
                .addContainerGap(64, Short.MAX_VALUE))
        );
        jPanel1Layout.setVerticalGroup(
            jPanel1Layout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING)
            .add(jPanel1Layout.createSequentialGroup()
                .addContainerGap()
                .add(jPanel1Layout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING)
                    .add(jPanel1Layout.createSequentialGroup()
                        .add(jPanel8, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                        .add(50, 50, 50))
                    .add(jPanel1Layout.createSequentialGroup()
                        .add(jScrollPane5, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, 198, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE)
                        .addPreferredGap(org.jdesktop.layout.LayoutStyle.UNRELATED)
                        .add(MostrarInsumoUso)
                        .addContainerGap())))
        );

        jPanel6.setBorder(javax.swing.BorderFactory.createEtchedBorder());

        jPanel7.setBorder(javax.swing.BorderFactory.createTitledBorder("Informacion Insumos Disponibles"));

        jLabel3.setText("Id:");

        jLabel4.setText("Concepto:");

        IdInsumoDisponible.setText("           ");

        ConceptoInsumoDisponible.setText("           ");

        jLabel7.setText("Categoria:");

        CategoriaInsumoDisponible.setText("           ");

        diaInsumo1.setModel(new javax.swing.DefaultComboBoxModel(new String[] { "01", "02", "03", "04", "05", "06", "07", "08", "09", "10", "11", "12", "13", "14", "15", "16", "17", "18", "19", "20", "21", "22", "23", "24", "25", "26", "27", "28", "29", "30", "31" }));
        diaInsumo1.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                diaInsumo1ActionPerformed(evt);
            }
        });

        jLabel1.setText("Fecha:");

        mesInsumo1.setFont(new java.awt.Font("Tahoma", 0, 11));

        org.jdesktop.layout.GroupLayout jPanel7Layout = new org.jdesktop.layout.GroupLayout(jPanel7);
        jPanel7.setLayout(jPanel7Layout);
        jPanel7Layout.setHorizontalGroup(
            jPanel7Layout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING)
            .add(jPanel7Layout.createSequentialGroup()
                .add(18, 18, 18)
                .add(jPanel7Layout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING)
                    .add(jPanel7Layout.createSequentialGroup()
                        .add(jPanel7Layout.createParallelGroup(org.jdesktop.layout.GroupLayout.TRAILING)
                            .add(jLabel7)
                            .add(jPanel7Layout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING)
                                .add(jLabel3)
                                .add(jLabel4)))
                        .addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED)
                        .add(jPanel7Layout.createParallelGroup(org.jdesktop.layout.GroupLayout.TRAILING)
                            .add(ConceptoInsumoDisponible)
                            .add(IdInsumoDisponible)
                            .add(CategoriaInsumoDisponible)))
                    .add(jPanel7Layout.createSequentialGroup()
                        .add(jLabel1)
                        .addPreferredGap(org.jdesktop.layout.LayoutStyle.UNRELATED)
                        .add(diaInsumo1, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE)
                        .addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED)
                        .add(mesInsumo1, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)))
                .addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED)
                .add(anoInsumo1, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE)
                .addContainerGap())
        );
        jPanel7Layout.setVerticalGroup(
            jPanel7Layout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING)
            .add(jPanel7Layout.createSequentialGroup()
                .add(20, 20, 20)
                .add(jPanel7Layout.createParallelGroup(org.jdesktop.layout.GroupLayout.BASELINE)
                    .add(IdInsumoDisponible)
                    .add(jLabel3))
                .add(18, 18, 18)
                .add(jPanel7Layout.createParallelGroup(org.jdesktop.layout.GroupLayout.BASELINE)
                    .add(ConceptoInsumoDisponible)
                    .add(jLabel4))
                .addPreferredGap(org.jdesktop.layout.LayoutStyle.UNRELATED)
                .add(jPanel7Layout.createParallelGroup(org.jdesktop.layout.GroupLayout.BASELINE)
                    .add(CategoriaInsumoDisponible)
                    .add(jLabel7))
                .addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED)
                .add(jPanel7Layout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING)
                    .add(anoInsumo1, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE)
                    .add(jPanel7Layout.createParallelGroup(org.jdesktop.layout.GroupLayout.BASELINE)
                        .add(jLabel1)
                        .add(diaInsumo1, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE))
                    .add(mesInsumo1, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE))
                .addContainerGap(54, Short.MAX_VALUE))
        );

        TablaInsumoDisponible.setModel(new javax.swing.table.DefaultTableModel(
            new Object [][] {

            },
            new String [] {
                "Id_Insumo", "Concepto", "Id_Categoria"
            }
        ));
        TablaInsumoDisponible.addMouseListener(new java.awt.event.MouseAdapter() {
            public void mouseClicked(java.awt.event.MouseEvent evt) {
                TablaInsumoDisponibleMouseClicked(evt);
            }
        });
        jScrollPane4.setViewportView(TablaInsumoDisponible);

        MostrarInsumoDisponible.setText("Mostrar");
        MostrarInsumoDisponible.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                MostrarInsumoDisponibleActionPerformed(evt);
            }
        });

        org.jdesktop.layout.GroupLayout jPanel6Layout = new org.jdesktop.layout.GroupLayout(jPanel6);
        jPanel6.setLayout(jPanel6Layout);
        jPanel6Layout.setHorizontalGroup(
            jPanel6Layout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING)
            .add(org.jdesktop.layout.GroupLayout.TRAILING, jPanel6Layout.createSequentialGroup()
                .addContainerGap(org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                .add(jPanel6Layout.createParallelGroup(org.jdesktop.layout.GroupLayout.TRAILING)
                    .add(MostrarInsumoDisponible)
                    .add(jPanel6Layout.createSequentialGroup()
                        .add(jPanel7, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE)
                        .addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED)
                        .add(jScrollPane4, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, 491, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE)))
                .add(255, 255, 255))
        );
        jPanel6Layout.setVerticalGroup(
            jPanel6Layout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING)
            .add(org.jdesktop.layout.GroupLayout.TRAILING, jPanel6Layout.createSequentialGroup()
                .addContainerGap()
                .add(jPanel6Layout.createParallelGroup(org.jdesktop.layout.GroupLayout.TRAILING)
                    .add(jScrollPane4, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, 198, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE)
                    .add(jPanel7, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
                .addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED)
                .add(MostrarInsumoDisponible)
                .add(23, 23, 23))
        );

        org.jdesktop.layout.GroupLayout jPanel5Layout = new org.jdesktop.layout.GroupLayout(jPanel5);
        jPanel5.setLayout(jPanel5Layout);
        jPanel5Layout.setHorizontalGroup(
            jPanel5Layout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING)
            .add(jPanel5Layout.createSequentialGroup()
                .addContainerGap()
                .add(jPanel5Layout.createParallelGroup(org.jdesktop.layout.GroupLayout.TRAILING, false)
                    .add(org.jdesktop.layout.GroupLayout.LEADING, jPanel6, 0, 853, Short.MAX_VALUE)
                    .add(org.jdesktop.layout.GroupLayout.LEADING, jPanel1, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
                .addContainerGap(19, Short.MAX_VALUE))
        );
        jPanel5Layout.setVerticalGroup(
            jPanel5Layout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING)
            .add(jPanel5Layout.createSequentialGroup()
                .addContainerGap()
                .add(jPanel1, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE)
                .add(18, 18, 18)
                .add(jPanel6, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE)
                .addContainerGap(41, Short.MAX_VALUE))
        );

        PanelGeneral.addTab("Disponibilidad de Insumos", jPanel5);

        jPanel14.setBorder(javax.swing.BorderFactory.createTitledBorder(null, "Evento a consultar", javax.swing.border.TitledBorder.DEFAULT_JUSTIFICATION, javax.swing.border.TitledBorder.DEFAULT_POSITION, new java.awt.Font("Tahoma", 1, 11), new java.awt.Color(51, 102, 255))); // NOI18N

        jLabel2.setFont(new java.awt.Font("Tahoma", 1, 11));
        jLabel2.setText("Descripción del Evento:");

        jLabel5.setFont(new java.awt.Font("Tahoma", 1, 11));
        jLabel5.setText("Fecha:");

        jLabel6.setFont(new java.awt.Font("Tahoma", 1, 11));
        jLabel6.setText("Hora Inicio:");

        jLabel34.setFont(new java.awt.Font("Tahoma", 1, 11));
        jLabel34.setText("Hora Fin:");

        EventoConsulta.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                EventoConsultaActionPerformed(evt);
            }
        });

        HoraIConsulta.setText("00:00");

        HoraFConsulta.setText("00:00");

        FechaEventoConsulta.setText("----/--/--");

        jLabel37.setFont(new java.awt.Font("Tahoma", 1, 11));
        jLabel37.setText("Ejecutivo Encargado:");

        jLabel38.setText("Nombre del ejecutivo");

        jLabel39.setIcon(new javax.swing.ImageIcon(getClass().getResource("/Iconos/SolicitudOrdenCompra.PNG"))); // NOI18N

        org.jdesktop.layout.GroupLayout jPanel14Layout = new org.jdesktop.layout.GroupLayout(jPanel14);
        jPanel14.setLayout(jPanel14Layout);
        jPanel14Layout.setHorizontalGroup(
            jPanel14Layout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING)
            .add(jPanel14Layout.createSequentialGroup()
                .addContainerGap()
                .add(jLabel2)
                .addPreferredGap(org.jdesktop.layout.LayoutStyle.UNRELATED)
                .add(EventoConsulta, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, 206, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE)
                .add(34, 34, 34)
                .add(jPanel14Layout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING)
                    .add(jPanel14Layout.createSequentialGroup()
                        .add(jLabel37)
                        .addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED)
                        .add(jLabel38))
                    .add(jPanel14Layout.createSequentialGroup()
                        .add(jPanel14Layout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING)
                            .add(jLabel34)
                            .add(jLabel5)
                            .add(jLabel6))
                        .add(59, 59, 59)
                        .add(jPanel14Layout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING)
                            .add(FechaEventoConsulta)
                            .add(HoraIConsulta)
                            .add(HoraFConsulta))))
                .addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED, 126, Short.MAX_VALUE)
                .add(jLabel39)
                .addContainerGap())
        );
        jPanel14Layout.setVerticalGroup(
            jPanel14Layout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING)
            .add(jPanel14Layout.createSequentialGroup()
                .add(jPanel14Layout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING)
                    .add(jPanel14Layout.createSequentialGroup()
                        .add(20, 20, 20)
                        .add(jPanel14Layout.createParallelGroup(org.jdesktop.layout.GroupLayout.BASELINE)
                            .add(jLabel2, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, 14, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE)
                            .add(EventoConsulta, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE)))
                    .add(jPanel14Layout.createSequentialGroup()
                        .add(22, 22, 22)
                        .add(jPanel14Layout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING)
                            .add(jLabel38)
                            .add(jLabel37))
                        .addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED)
                        .add(jPanel14Layout.createParallelGroup(org.jdesktop.layout.GroupLayout.BASELINE)
                            .add(FechaEventoConsulta)
                            .add(jLabel5))
                        .addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED)
                        .add(jPanel14Layout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING)
                            .add(HoraIConsulta)
                            .add(jLabel6))
                        .addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED)
                        .add(jPanel14Layout.createParallelGroup(org.jdesktop.layout.GroupLayout.BASELINE)
                            .add(jLabel34)
                            .add(HoraFConsulta)))
                    .add(jLabel39))
                .addContainerGap(11, Short.MAX_VALUE))
        );

        PanelInsumoEvento.setBorder(javax.swing.BorderFactory.createTitledBorder(null, "Insumos del evento seleccionado", javax.swing.border.TitledBorder.DEFAULT_JUSTIFICATION, javax.swing.border.TitledBorder.DEFAULT_POSITION, new java.awt.Font("Tahoma", 1, 11), new java.awt.Color(51, 102, 255))); // NOI18N

        TablaEventoInsumo.setModel(new javax.swing.table.DefaultTableModel(
            new Object [][] {
                {null, null, null},
                {null, null, null},
                {null, null, null},
                {null, null, null}
            },
            new String [] {
                "Código", "Concepto", "Cantidad"
            }
        ) {
            boolean[] canEdit = new boolean [] {
                false, false, false
            };

            public boolean isCellEditable(int rowIndex, int columnIndex) {
                return canEdit [columnIndex];
            }
        });
        jScrollPane1.setViewportView(TablaEventoInsumo);

        CategoriaInsumoEvento.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                CategoriaInsumoEventoActionPerformed(evt);
            }
        });
        CategoriaInsumoEvento.addAncestorListener(new javax.swing.event.AncestorListener() {
            public void ancestorMoved(javax.swing.event.AncestorEvent evt) {
            }
            public void ancestorAdded(javax.swing.event.AncestorEvent evt) {
                CategoriaInsumoEventoAncestorAdded(evt);
            }
            public void ancestorRemoved(javax.swing.event.AncestorEvent evt) {
            }
        });

        jLabel36.setFont(new java.awt.Font("Tahoma", 1, 11));
        jLabel36.setText("Por Categoria:");

        org.jdesktop.layout.GroupLayout PanelInsumoEventoLayout = new org.jdesktop.layout.GroupLayout(PanelInsumoEvento);
        PanelInsumoEvento.setLayout(PanelInsumoEventoLayout);
        PanelInsumoEventoLayout.setHorizontalGroup(
            PanelInsumoEventoLayout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING)
            .add(PanelInsumoEventoLayout.createSequentialGroup()
                .addContainerGap()
                .add(PanelInsumoEventoLayout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING)
                    .add(org.jdesktop.layout.GroupLayout.TRAILING, jScrollPane1, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, 821, Short.MAX_VALUE)
                    .add(PanelInsumoEventoLayout.createSequentialGroup()
                        .add(jLabel36)
                        .add(18, 18, 18)
                        .add(CategoriaInsumoEvento, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, 124, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE)))
                .addContainerGap())
        );
        PanelInsumoEventoLayout.setVerticalGroup(
            PanelInsumoEventoLayout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING)
            .add(org.jdesktop.layout.GroupLayout.TRAILING, PanelInsumoEventoLayout.createSequentialGroup()
                .add(PanelInsumoEventoLayout.createParallelGroup(org.jdesktop.layout.GroupLayout.BASELINE)
                    .add(jLabel36)
                    .add(CategoriaInsumoEvento, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE))
                .addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED, 47, Short.MAX_VALUE)
                .add(jScrollPane1, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, 172, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE)
                .add(20, 20, 20))
        );

        Consultar.setText("Consultar");
        Consultar.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                ConsultarActionPerformed(evt);
            }
        });

        org.jdesktop.layout.GroupLayout jPanel4Layout = new org.jdesktop.layout.GroupLayout(jPanel4);
        jPanel4.setLayout(jPanel4Layout);
        jPanel4Layout.setHorizontalGroup(
            jPanel4Layout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING)
            .add(jPanel4Layout.createSequentialGroup()
                .add(10, 10, 10)
                .add(jPanel4Layout.createParallelGroup(org.jdesktop.layout.GroupLayout.TRAILING)
                    .add(Consultar)
                    .add(jPanel4Layout.createParallelGroup(org.jdesktop.layout.GroupLayout.TRAILING, false)
                        .add(org.jdesktop.layout.GroupLayout.LEADING, jPanel4Layout.createSequentialGroup()
                            .addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED)
                            .add(PanelInsumoEvento, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
                        .add(org.jdesktop.layout.GroupLayout.LEADING, jPanel4Layout.createSequentialGroup()
                            .add(14, 14, 14)
                            .add(jPanel14, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE))))
                .addContainerGap())
        );
        jPanel4Layout.setVerticalGroup(
            jPanel4Layout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING)
            .add(jPanel4Layout.createSequentialGroup()
                .addContainerGap()
                .add(jPanel14, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE)
                .addPreferredGap(org.jdesktop.layout.LayoutStyle.UNRELATED)
                .add(PanelInsumoEvento, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                .add(46, 46, 46)
                .add(Consultar)
                .add(87, 87, 87))
        );

        PanelGeneral.addTab("Atencion General", jPanel4);

        archivo.setText("Archivo");

        nuevaCotizacion.setAccelerator(javax.swing.KeyStroke.getKeyStroke(java.awt.event.KeyEvent.VK_C, java.awt.event.InputEvent.CTRL_MASK));
        nuevaCotizacion.setIcon(new javax.swing.ImageIcon(getClass().getResource("/Iconos/add.png"))); // NOI18N
        nuevaCotizacion.setText("Nueva Cotizacion...");
        nuevaCotizacion.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                nuevaCotizacionActionPerformed(evt);
            }
        });
        archivo.add(nuevaCotizacion);

        informacionSistema.setAccelerator(javax.swing.KeyStroke.getKeyStroke(java.awt.event.KeyEvent.VK_S, java.awt.event.InputEvent.CTRL_MASK));
        informacionSistema.setIcon(new javax.swing.ImageIcon(getClass().getResource("/Iconos/database.png"))); // NOI18N
        informacionSistema.setText("Informacion del Sistema...");
        informacionSistema.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                informacionSistemaActionPerformed(evt);
            }
        });
        archivo.add(informacionSistema);

        jMenuItem2.setAccelerator(javax.swing.KeyStroke.getKeyStroke(java.awt.event.KeyEvent.VK_P, java.awt.event.InputEvent.CTRL_MASK));
        jMenuItem2.setIcon(new javax.swing.ImageIcon(getClass().getResource("/Iconos/money.png"))); // NOI18N
        jMenuItem2.setText("Cancelacion de Eventos");
        jMenuItem2.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jMenuItem2ActionPerformed(evt);
            }
        });
        archivo.add(jMenuItem2);
        archivo.add(jSeparator1);

        exit.setAccelerator(javax.swing.KeyStroke.getKeyStroke(java.awt.event.KeyEvent.VK_E, java.awt.event.InputEvent.CTRL_MASK));
        exit.setIcon(new javax.swing.ImageIcon(getClass().getResource("/Iconos/exit.png"))); // NOI18N
        exit.setText("Salir");
        exit.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                exitActionPerformed(evt);
            }
        });
        archivo.add(exit);

        jMenuBar1.add(archivo);

        jMenu1.setText("Ayuda");

        acercaDe.setAccelerator(javax.swing.KeyStroke.getKeyStroke(java.awt.event.KeyEvent.VK_A, java.awt.event.InputEvent.CTRL_MASK));
        acercaDe.setIcon(new javax.swing.ImageIcon(getClass().getResource("/Iconos/info.png"))); // NOI18N
        acercaDe.setText("Acerca de MDJ");
        acercaDe.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                acercaDeActionPerformed(evt);
            }
        });
        jMenu1.add(acercaDe);

        jMenuBar1.add(jMenu1);

        setJMenuBar(jMenuBar1);

        org.jdesktop.layout.GroupLayout layout = new org.jdesktop.layout.GroupLayout(getContentPane());
        getContentPane().setLayout(layout);
        layout.setHorizontalGroup(
            layout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING)
            .add(layout.createSequentialGroup()
                .add(layout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING)
                    .add(layout.createSequentialGroup()
                        .add(18, 18, 18)
                        .add(PanelGeneral, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, 887, Short.MAX_VALUE))
                    .add(org.jdesktop.layout.GroupLayout.TRAILING, layout.createSequentialGroup()
                        .addContainerGap(832, Short.MAX_VALUE)
                        .add(salir)))
                .addContainerGap())
        );
        layout.setVerticalGroup(
            layout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING)
            .add(org.jdesktop.layout.GroupLayout.TRAILING, layout.createSequentialGroup()
                .addContainerGap()
                .add(PanelGeneral, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, 626, Short.MAX_VALUE)
                .addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED)
                .add(salir)
                .addContainerGap())
        );

        pack();
    }// </editor-fold>//GEN-END:initComponents

    private void nuevaCotizacionActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_nuevaCotizacionActionPerformed
        NuevaCotizacion cot = null;
        try {
            cot = new NuevaCotizacion();
        } catch (SQLException ex) {
            Logger.getLogger(Insumo_Inventarios.class.getName()).log(Level.SEVERE, null, ex);
        }
        cot.setVisible(true);
}//GEN-LAST:event_nuevaCotizacionActionPerformed

    private void informacionSistemaActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_informacionSistemaActionPerformed
        Informacion info = new Informacion();
        info.setVisible(true);
}//GEN-LAST:event_informacionSistemaActionPerformed

    private void exitActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_exitActionPerformed
int resultado = JOptionPane.showConfirmDialog(null, "Esta seguro que desea realizar esta operacion?", "ATENCION", JOptionPane.OK_CANCEL_OPTION);
    if (resultado==0){
        System.exit(0);
    }
}//GEN-LAST:event_exitActionPerformed

    private void salirActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_salirActionPerformed
int resultado = JOptionPane.showConfirmDialog(null, "Esta seguro que desea salir del sistema?", "ATENCION", JOptionPane.OK_CANCEL_OPTION);
    if (resultado==0){
        System.exit(0);
    }
}//GEN-LAST:event_salirActionPerformed

    private void acercaDeActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_acercaDeActionPerformed
    About ab = new About();
    ab.setVisible(true);
    }//GEN-LAST:event_acercaDeActionPerformed

    private void ModificarInsumoActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_ModificarInsumoActionPerformed
        // TODO add your handling code here:
        try {
            control_insumo = new ControlInsumo();
            List<Insumo> insumos = control_insumo.consultarInsumo();
            control_categoria = new ControlCategoria();
            List<Categoria> categoria = control_categoria.consultarCategoria();
           control_InsumoInventario  = new ControlInsumoInventario();
            List<InsumoInventario> insumo_inventario = control_InsumoInventario.consultarInsumoInventario();
            //List<Categoria> categorias = control_categoria.consultarCategoria();

            Integer id = Integer.parseInt(idInsumo1.getText());
            Integer cantidad = Integer.parseInt(CantidadInsumoModificar.getText());
            Double costo = Double.valueOf(CostoInsumoModificar.getText());
            String NomCategoria = CategoriaModificar.getSelectedItem().toString();
            Integer idCat =0;

            for (int i=0;i<categoria.size();i++){
                if (categoria.get(i).getNombre().equals(NomCategoria)){
                    idCat = categoria.get(i).getidCATEGORIA();
                    System.out.println(categoria.get(i).getidCATEGORIA()+""+categoria.get(i).getNombre());
                }
            }

            for (Iterator iter = insumos.iterator(); iter.hasNext(); ) {
                Insumo ins = (Insumo) iter.next();

                if(ins.getIdINSUMO()==id.intValue()){

                    if(CheckNombreInsumo.isSelected()){
                        ins.setConcepto(NombreInsumo3.getText());

                    }
                    if (CheckCategoriaInsumo.isSelected()){
                        ins.setidCATEGORIA(idCat);
                    }


                    boolean result = control_insumo.modificarInsumo(ins);
                    insumos = control_insumo.consultarInsumo();

                    //if(result){
                        //this.cargarTablaInsumos(insumos,categoria,insumo_inventario);
                        //this.asignarLabelInsumos(insumos);
                        //this.cargarIdCategorias_Insumos();
                       // JOptionPane.showMessageDialog(aviso,"El insumo ha sido modificado con Exito","Nota", 1);
                    //}else{
                        //JOptionPane.showMessageDialog(aviso,"El insumo no pudo ser modificado","Nota", 1);
                    //}
                }
            }

               for (Iterator it=insumo_inventario.iterator();it.hasNext();){
                    InsumoInventario inv = (InsumoInventario) it.next();

                  if (inv.getINSUMO_idINSUMO().equals(id.intValue())){

                      if(CheckCantidadInsumo.isSelected()){
                          inv.setCantidad(cantidad);
                      }

                      if(CheckCostoInsumo.isSelected()){
                          inv.setCostoUnitario(costo);
                      }

                      boolean result2 = control_InsumoInventario.modificarInsumoInventario(inv);
                      insumo_inventario = control_InsumoInventario.consultarInsumoInventario();
                        if(result2){
                            this.cargarTablaInsumos(insumos,categoria,insumo_inventario);
                        this.asignarLabelInsumos(insumos);
                        this.cargarIdCategorias_Insumos();
                            
                        JOptionPane.showMessageDialog(aviso,"El insumo ha sido modificado con Exito","Nota", 1);
                    }else{
                        JOptionPane.showMessageDialog(aviso,"El insumo no pudo ser modificado","Nota", 1);
                    }


                }
            }

        } catch (IOException ex) {
            Logger.getLogger(InformacionSistema.class.getName()).log(Level.SEVERE, null, ex);
        } catch (SQLException ex) {
            Logger.getLogger(InformacionSistema.class.getName()).log(Level.SEVERE, null, ex);
        }
    }//GEN-LAST:event_ModificarInsumoActionPerformed

    private void NombreInsumo3ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_NombreInsumo3ActionPerformed
        // TODO add your handling code here:
}//GEN-LAST:event_NombreInsumo3ActionPerformed

    private void EliminarInsumoActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_EliminarInsumoActionPerformed

        int resultado = JOptionPane.showConfirmDialog(null, "Esta seguro que desea realizar esta operacion?", "ATENCION", JOptionPane.OK_CANCEL_OPTION);

        if (resultado==0){

            try {

                control_categoria = new ControlCategoria();
                List<Categoria> categorias = control_categoria.consultarCategoria();
                control_insumo = new ControlInsumo();
                List<Insumo> insumos = control_insumo.consultarInsumo();
                control_InsumoInventario = new ControlInsumoInventario();
                List<InsumoInventario> insumo_inventario = control_InsumoInventario.consultarInsumoInventario();
                control_inventario = new ControlInventario();
                List<Inventario> inventario = control_inventario.consultarInventario();

                Integer Id = Integer.parseInt(idInsumo.getText().toString());

                for (int i=0;i<insumos.size();i++){
                    if(insumos.get(i).getIdINSUMO().equals(Id)){
                        boolean result = control_insumo.eliminarInsumo(insumos.get(i));
                        insumos = control_insumo.consultarInsumo();

                        if (result){

                            //IdInsumo.removeItem(Id);

                            //this.cargarTablaInsumos(insumos,categorias);
                            this.cargarIdCategorias_Insumos();
                            this.cargarIdInsumos();
                            JOptionPane.showMessageDialog(aviso,"El insumo ha sido eliminado con Exito ","Nota", 1);

                        } else{
                            JOptionPane.showMessageDialog(aviso,"El insumo no se pudo eliminar","Nota", 1);
                        }
                    }
                }

                Integer idInventario=0;
                for (int j=0;j<insumo_inventario.size();j++){
                    if(insumo_inventario.get(j).getINSUMO_idINSUMO().equals(Id)){
                        idInventario = insumo_inventario.get(j).getINVENTARIO_idINVENTARIO();
                        control_InsumoInventario.eliminarInsumoInventario(insumo_inventario.get(j));
                        insumo_inventario = control_InsumoInventario.consultarInsumoInventario();
                    }
                }

                for (int k=0;k<inventario.size();k++){
                    if (inventario.get(k).getidInventario().equals(idInventario)){
                        control_inventario.eliminarInventario(inventario.get(k));
                        inventario = control_inventario.consultarInventario();
                    }
                }

                this.cargarTablaInsumos(insumos,categorias,insumo_inventario);
                            this.cargarIdCategorias_Insumos();
                            this.cargarIdInsumos();

            } catch (IOException ex) {
                Logger.getLogger(InformacionSistema.class.getName()).log(Level.SEVERE, null, ex);
            } catch (SQLException ex) {
                Logger.getLogger(InformacionSistema.class.getName()).log(Level.SEVERE, null, ex);
            }
        }
}//GEN-LAST:event_EliminarInsumoActionPerformed

    private void CategoriasActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_CategoriasActionPerformed
        // TODO add your handling code here:
}//GEN-LAST:event_CategoriasActionPerformed

    private void InsertarInsumoActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_InsertarInsumoActionPerformed
        // TODO add your handling code here:
        try {
            // TODO add your handling code here:
            control_insumo = new ControlInsumo();
            
            control_categoria = new ControlCategoria();
            control_InsumoInventario  = new ControlInsumoInventario();
            control_inventario = new ControlInventario();
            
            List<Categoria> categorias = control_categoria.consultarCategoria();

            //List<InsumoInventario> insumo_inventario = control_InsumoInventario.consultarInsumoInventario();
            if ((NombreInsumo.getText().equals(""))|| (CantidadInsumo.getText().equals("0"))||(CostoInsumo.getText().equals("0")) ){
                JOptionPane.showMessageDialog(aviso,"Debe llenar todos los campos ","Warning", 1);

            }else{
                String Nombre = NombreInsumo.getText();
                Integer cantidad = Integer.parseInt(CantidadInsumo.getText());
                double CostoUnitario = Double.valueOf(CostoInsumo.getText());



                String categ = Categorias.getSelectedItem().toString();
                int id=0;


                for (int i=0;i<categorias.size();i++){
                    if(categorias.get(i).getNombre().equals(categ)){
                        id = categorias.get(i).getidCATEGORIA();
                        System.out.println(id);
                    }
                }
               String descripcion = " ";

                Insumo insumo = new Insumo(Nombre,id);
                Inventario inventario = new Inventario(descripcion);



                boolean result = control_insumo.agregarInsumo(insumo);
                control_inventario.agregarInventario(inventario);

                //ControlInsumo control_insumo= new ControlInsumo();
            List<Insumo> insumos = control_insumo.consultarInsumo();
            //ControlInventario control_inventario = new ControlInventario();
            List<Inventario> inventarios = control_inventario.consultarInventario();
            Integer idInsumo=0;
            Integer idInventario=0;
            //System.out.println(insumos.size());
            for (int i=0;i<insumos.size();i++){
                //System.out.println(insumos.get(i).getIdINSUMO());
                //System.out.println(i);
                if (i==insumos.size()-1){
                     idInsumo=insumos.get(i).getIdINSUMO();
                }
            }

            System.out.println("Inventarios");

            for (int j=0; j<inventarios.size();j++){
                System.out.println(inventarios.get(j).getidInventario());
                System.out.println(j);
                if(j==inventarios.size()-1){
                    idInventario=inventarios.get(j).getidInventario();
                }
            }






            //Integer idInventario = inventario.size();
            //System.out.println(idInsumo);
            //System.out.println(idInventario);





            InsumoInventario insumo_inventario = new InsumoInventario(idInsumo,idInventario,cantidad,CostoUnitario);
            //Inventario inventario = new Inventario(80);


//               List <Insumo> insumos = control_insumo.consultarInsumo();
//                List<Inventario> inventarios = control_inventario.consultarInventario();
//               int idInsumo = insumos.size();
//                int idInventario = inventarios.size();
//                Integer InsumoFinal = insumos.get(idInsumo).getIdINSUMO();
//                Integer InventarioFinal = inventarios.get(idInventario).getidInventario();
//
//                InsumoInventario insumo_inventario = new InsumoInventario(InsumoFinal,InventarioFinal,cantidad,CostoUnitario);
                boolean result3 = control_InsumoInventario.agregarInsumoInventario(insumo_inventario);
                List<InsumoInventario> insumos_inventarios = control_InsumoInventario.consultarInsumoInventario();

                if(result){
                    JOptionPane.showMessageDialog(aviso,"El insumo ha sido agregado con Exito","Nota", 1);
                    this.cargarTablaInsumos(insumos,categorias, insumos_inventarios);
                    this.cargarIdCategorias_Insumos();
                    this.cargarIdInsumos();

                }else{
                    JOptionPane.showMessageDialog(aviso,"El insumo no pudo ser agregado","Nota", 1);
                }
            }

        } catch (IOException ex) {
            Logger.getLogger(Insumo_Inventarios.class.getName()).log(Level.SEVERE, null, ex);
        } catch (SQLException ex) {
            Logger.getLogger(Insumo_Inventarios.class.getName()).log(Level.SEVERE, null, ex);
        }


    }//GEN-LAST:event_InsertarInsumoActionPerformed

    private void NombreInsumoActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_NombreInsumoActionPerformed
        // TODO add your handling code here:
    }//GEN-LAST:event_NombreInsumoActionPerformed

    private void Mostrar_InsumosActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_Mostrar_InsumosActionPerformed
        try {
            // TODO add your handling code here:
            control_insumo = new ControlInsumo();
            control_categoria = new ControlCategoria();
            control_InsumoInventario = new ControlInsumoInventario();

            List<Insumo> insumos = control_insumo.consultarInsumo();
            List<InsumoInventario> insumo_inventario = control_InsumoInventario.consultarInsumoInventario();
            List<Categoria> categorias = control_categoria.consultarCategoria();


            this.cargarTablaInsumos(insumos, categorias,insumo_inventario);
            this.cargarIdCategorias_Insumos();
            //this.cargarIdInsumos();


        } catch (IOException ex) {
            Logger.getLogger(Insumo_Inventarios.class.getName()).log(Level.SEVERE, null, ex);
        } catch (SQLException ex) {
            Logger.getLogger(Insumo_Inventarios.class.getName()).log(Level.SEVERE, null, ex);
        }

    }//GEN-LAST:event_Mostrar_InsumosActionPerformed

    private void ModificarCategoriaActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_ModificarCategoriaActionPerformed
        // TODO add your handling code here:
        try {
            control_categoria = new ControlCategoria();
            List<Categoria> categorias = control_categoria.consultarCategoria();
            Integer id = Integer.parseInt(idCategoria1.getText());

            for (Iterator iter = categorias.iterator(); iter.hasNext(); ) {
                Categoria cat = (Categoria) iter.next();

                if(cat.getidCATEGORIA()==id.intValue()){

                    if(CheckNombreCategoria.isSelected()){
                        cat.setNombre(NombreCategoria3.getText());
                    }


                    boolean result = control_categoria.modificarCategoria(cat);
                    categorias = control_categoria.consultarCategoria();

                    if(result){
                        this.cargarTablaCategorias(categorias);
                        //this.asignarLabelCategorias(categorias);
                        JOptionPane.showMessageDialog(aviso,"La categoria ha sido modificada con Exito","Nota", 1);
                    }else{
                        JOptionPane.showMessageDialog(aviso,"La categoria no pudo ser modificada","Nota", 1);
                    }
                }
            }

        } catch (IOException ex) {
            Logger.getLogger(InformacionSistema.class.getName()).log(Level.SEVERE, null, ex);
        } catch (SQLException ex) {
            Logger.getLogger(InformacionSistema.class.getName()).log(Level.SEVERE, null, ex);
        }
}//GEN-LAST:event_ModificarCategoriaActionPerformed

    private void CheckNombreCategoriaActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_CheckNombreCategoriaActionPerformed
        // TODO add your handling code here:
        if (CheckNombreCategoria.isSelected()){
            NombreCategoria3.setEnabled(true);

        }else{
            NombreCategoria3.setEnabled(false);
        }
        
}//GEN-LAST:event_CheckNombreCategoriaActionPerformed

    private void NombreCategoria3ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_NombreCategoria3ActionPerformed
        // TODO add your handling code here:
}//GEN-LAST:event_NombreCategoria3ActionPerformed

    private void eliminarCategoria1ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_eliminarCategoria1ActionPerformed
        // TODO add your handling code here:
        // TODO add your handling code here:
        int resultado = JOptionPane.showConfirmDialog(null, "Esta seguro que desea realizar esta operacion?", "ATENCION", JOptionPane.OK_CANCEL_OPTION);

        if (resultado==0){

            try {
                control_categoria = new ControlCategoria();
                List<Categoria> categorias = control_categoria.consultarCategoria();
                Integer id = Integer.parseInt(idCategoria.getText());

                for (int i=0;i<categorias.size();i++){
                    if(categorias.get(i).getidCATEGORIA().equals(id)){
                        boolean result = control_categoria.eliminarCategoria(categorias.get(i));
                        categorias = control_categoria.consultarCategoria();

                        if (result){

                            //IdCategoria.removeItem(id);
                            //IdCategoria2.removeItem(id);
                            this.cargarTablaCategorias(categorias);
                            //this.cargarIdCategorias();

                            JOptionPane.showMessageDialog(aviso,"La categoria ha sido eliminada con Exito ","Nota", 1);

                        } else{
                            JOptionPane.showMessageDialog(aviso,"La categoria no se pudo eliminar","Nota", 1);
                        }
                    }
                }
            } catch (IOException ex) {
                Logger.getLogger(Insumo_Inventarios.class.getName()).log(Level.SEVERE, null, ex);
            } catch (SQLException ex) {
                Logger.getLogger(Insumo_Inventarios.class.getName()).log(Level.SEVERE, null, ex);
            }
        }
}//GEN-LAST:event_eliminarCategoria1ActionPerformed

    private void InsertarCategoriaActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_InsertarCategoriaActionPerformed
        // TODO add your handling code here:
        try {
            // TODO add your handling code here:
            control_categoria = new ControlCategoria();
            if (NombreCategoria.getText().equals("")){
                JOptionPane.showMessageDialog(aviso,"Debe llenar todos los campos ","Warning", 1);

            }else{
                String Nombre = NombreCategoria.getText();

                Categoria categoria = new Categoria(Nombre);
                boolean result = control_categoria.agregarCategoria(categoria);
                List <Categoria> categorias = control_categoria.consultarCategoria();
                if(result){
                    JOptionPane.showMessageDialog(aviso,"La categoria ha sido agregada con Exito","Nota", 1);
                    this.cargarTablaCategorias(categorias);
                    //this.cargarIdCategorias();

                }else{
                    JOptionPane.showMessageDialog(aviso,"La categoria no pudo ser agregada","Nota", 1);
                }
            }

        } catch (IOException ex) {
            Logger.getLogger(Insumo_Inventarios.class.getName()).log(Level.SEVERE, null, ex);
        } catch (SQLException ex) {
            Logger.getLogger(Insumo_Inventarios.class.getName()).log(Level.SEVERE, null, ex);
        }
}//GEN-LAST:event_InsertarCategoriaActionPerformed

    private void NombreCategoriaActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_NombreCategoriaActionPerformed
        // TODO add your handling code here:
}//GEN-LAST:event_NombreCategoriaActionPerformed

    private void Mostrar_CategoriasActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_Mostrar_CategoriasActionPerformed
        // TODO add your handling code here:
        try {
            // TODO add your handling code here:
            control_categoria = new ControlCategoria();
            List <Categoria> categorias = control_categoria.consultarCategoria();
            this.cargarTablaCategorias(categorias);
            //this.cargarIdCategorias();

        } catch (IOException ex) {
            Logger.getLogger(Insumo_Inventarios.class.getName()).log(Level.SEVERE, null, ex);
        } catch (SQLException ex) {
            Logger.getLogger(Insumo_Inventarios.class.getName()).log(Level.SEVERE, null, ex);
        }
    }//GEN-LAST:event_Mostrar_CategoriasActionPerformed

    private void CategoriaModificarActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_CategoriaModificarActionPerformed
//        try {
//            // TODO add your handling code here:
//            Integer idIns = Integer.parseInt(IdInsumo2.getSelectedItem().toString());
//            control_insumo = new ControlInsumo();
//            List<Insumo> insumos = control_insumo.consultarInsumo();
//            control_categoria = new ControlCategoria();
//            List<Categoria> categorias = control_categoria.consultarCategoria();
//            Integer idCat = 0;
//            String nomCat = null;
//            for (int i = 0; i < insumos.size(); i++) {
//                if (insumos.get(i).getIdINSUMO().equals(idIns)) {
//                    idCat = insumos.get(i).getidCATEGORIA();
//                }
//            }
//
//            for (int j=0; j<categorias.size();j++){
//                if (categorias.get(j).getidCATEGORIA().equals(idCat)){
//                    nomCat = categorias.get(j).getNombre();
//                }
//            }
//            CategoriaModificar.setSelectedItem(nomCat);
//
//        } catch (IOException ex) {
//            Logger.getLogger(Insumo_Inventarios.class.getName()).log(Level.SEVERE, null, ex);
//        } catch (SQLException ex) {
//            Logger.getLogger(Insumo_Inventarios.class.getName()).log(Level.SEVERE, null, ex);
//        }





    }//GEN-LAST:event_CategoriaModificarActionPerformed

    private void CheckNombreInsumoActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_CheckNombreInsumoActionPerformed
        // TODO add your handling code here:
        if (CheckNombreInsumo.isSelected()){
            NombreInsumo3.setEnabled(true);
        }else{
            NombreInsumo3.setEnabled(false);
        }
        


               

    }//GEN-LAST:event_CheckNombreInsumoActionPerformed

    private void CheckCantidadInsumoActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_CheckCantidadInsumoActionPerformed
        // TODO add your handling code here:
        if (CheckCantidadInsumo.isSelected()){
            CantidadInsumoModificar.setEnabled(true);
        }else{
            CantidadInsumoModificar.setEnabled(false);
        }
    }//GEN-LAST:event_CheckCantidadInsumoActionPerformed

    private void CheckCostoInsumoActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_CheckCostoInsumoActionPerformed
        // TODO add your handling code here:
        if (CheckCostoInsumo.isSelected()){
            CostoInsumoModificar.setEnabled(true);
        }else{
            CostoInsumoModificar.setEnabled(false);
        }
    }//GEN-LAST:event_CheckCostoInsumoActionPerformed

    private void CheckCategoriaInsumoActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_CheckCategoriaInsumoActionPerformed
        // TODO add your handling code here:
        if (CheckCategoriaInsumo.isSelected()){
            CategoriaModificar.setEnabled(true);
        }else{
            CategoriaModificar.setEnabled(false);
        }
    }//GEN-LAST:event_CheckCategoriaInsumoActionPerformed


    private void MostrarInsumoDisponibleActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_MostrarInsumoDisponibleActionPerformed
        DefaultTableModel dm =  new DefaultTableModel();
            dm.addColumn("Id");
            dm.addColumn("Concepto");
        try {
            // TODO add your handling code here:
            control_evento = new ControlEvento();
            //List<Insumo> insumos2 = null;


            List<Evento> evento = control_evento.consultarEventos();
            
            //List<Uso> usos2=null;
            //List<Insumo> insumos2=null;
            control_insumo =  new ControlInsumo();

            List<Insumo> insumos = control_insumo.consultarInsumo();
            control_uso = new ControlUso();
            List<Uso> usos = control_uso.consultarUso();
            Date fecha = null;

            String dia = diaInsumo1.getSelectedItem().toString();
            //System.out.println(mesInsumo1.getMonth()+1);
            String mes = String.valueOf(mesInsumo1.getMonth()+1);
            int ano = anoInsumo1.getYear();
            String anho = String.valueOf(ano);
            String time = anho+"-"+mes+"-"+dia;
            fecha = Date.valueOf(time);
            System.out.println(fecha);
            List<Insumo> insumos2 = insumos;
           
                    
                   
                
              
            
                for (int i=0; i<evento.size();i++){
                    if(evento.get(i).getFecha().equals(fecha)){
                        for(int j=0;j<usos.size();j++){
                            if(evento.get(i).getIdEvento().equals(usos.get(j).getEVENTO_idEVENTO())){
                                for(int k=0;k<insumos.size();k++){
                                    if(insumos.get(k).getIdINSUMO().equals(usos.get(j).getINSUMO_idINSUMO())){
                                        //System.out.println(insumos.get(k).getIdINSUMO());

                                        //System.out.println(insumos.get(k).getConcepto());
                                        Insumo o = new Insumo();
                                         o = insumos.get(k);
                                        insumos2.remove(o);
                                    }
                                }

                                //System.out.println(usos.get(j).getINSUMO_idINSUMO());
                            }
                        }
                    }
                   }


                    for (int i=0;i<insumos2.size();i++){
                        Vector v = new Vector();
                        v.addElement(insumos2.get(i).getIdINSUMO());
                        v.addElement(insumos2.get(i).getConcepto());
                        dm.addRow(v);
              //          System.out.println(insumos2.get(i).getConcepto());
                    }

            //System.out.println(dm.getRowCount());
            TablaInsumoDisponible.setModel(dm);
            //TablaInsumoDisponible.setEnabled(false);
                                
             //(evento.get(i));

              

            //eventos2.add(evento.get(i).getDescripcion());
                
            

            
            


            //System.out.println(eventos2.get(0).getDescripcion());
//            int p=0;
//            for (int i =0;i<usos.size();i++){
//                for (int j=0;j<evento.size();j++){
//                    if (usos.get(i).getEVENTO_idEVENTO().equals(evento.get(j).getIdEvento())){
//                       usos2.add(p,usos.get(i));
//                       System.out.println(usos2.get(p).getEVENTO_idEVENTO());
//                       p++;
//                    }
//                }
//            }

           











        } catch (IOException ex) {
            Logger.getLogger(Insumo_Inventarios.class.getName()).log(Level.SEVERE, null, ex);
        } catch (SQLException ex) {
            Logger.getLogger(Insumo_Inventarios.class.getName()).log(Level.SEVERE, null, ex);
        }


    }//GEN-LAST:event_MostrarInsumoDisponibleActionPerformed

    private void MostrarInsumoUsoActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_MostrarInsumoUsoActionPerformed

        DefaultTableModel dm =  new DefaultTableModel();
            dm.addColumn("Id");
            dm.addColumn("Concepto");
            
        try {
            
            // TODO add your handling code here:
            control_evento = new ControlEvento();
            //List<Insumo> insumos2 = null;




            List<Evento> evento = control_evento.consultarEventos();

            //List<Uso> usos2=null;
            //List<Insumo> insumos2=null;
            control_insumo =  new ControlInsumo();

            List<Insumo> insumos = control_insumo.consultarInsumo();
            control_uso = new ControlUso();
            List<Uso> usos = control_uso.consultarUso();
            Date fecha = null;

            String dia = diaInsumo.getSelectedItem().toString();
            //System.out.println(mesInsumo.getMonth()+1);
            String mes = String.valueOf(mesInsumo.getMonth()+1);
            int ano = anoInsumo.getYear();
            String anho = String.valueOf(ano);
            String time = anho+"-"+mes+"-"+dia;

            fecha = Date.valueOf(time);
            System.out.println(fecha);
            List<Insumo> insumos2 = insumos;






                for (int i=0; i<evento.size();i++){

                    if(evento.get(i).getFecha().equals(fecha)){
                        for(int j=0;j<usos.size();j++){
                            if(evento.get(i).getIdEvento().equals(usos.get(j).getEVENTO_idEVENTO())){
                                for(int k=0;k<insumos.size();k++){
                                    if(insumos.get(k).getIdINSUMO().equals(usos.get(j).getINSUMO_idINSUMO())){
                                        Vector v = new Vector();
              //                          System.out.println(insumos.get(k).getIdINSUMO());
                                        v.addElement(insumos.get(k).getIdINSUMO());
                                        v.addElement(insumos.get(k).getConcepto());
                                        
                                        dm.addRow(v);
                //                        System.out.println(insumos.get(k).getConcepto());
                                        //Insumo o = new Insumo();
                                         //o = insumos.get(k);
                                        //insumos2.remove(o);
                                    }

                                }

                                //System.out.println(usos.get(j).getINSUMO_idINSUMO());
                            }
                        }
                    }
                   }


                    //for (int i=0;i<insumos2.size();i++){
                       // System.out.println(insumos2.get(i).getConcepto());
                    //}

             //(evento.get(i));



            //eventos2.add(evento.get(i).getDescripcion());







            //System.out.println(eventos2.get(0).getDescripcion());
//            int p=0;
//            for (int i =0;i<usos.size();i++){
//                for (int j=0;j<evento.size();j++){
//                    if (usos.get(i).getEVENTO_idEVENTO().equals(evento.get(j).getIdEvento())){
//                       usos2.add(p,usos.get(i));
//                       System.out.println(usos2.get(p).getEVENTO_idEVENTO());
//                       p++;
//                    }
//                }
//            }










            //System.out.println(dm.getRowCount());
            if(dm.getRowCount()==0)
                JOptionPane.showMessageDialog(aviso, "No hay Insumos en uso");


            TablaInsumoUso.setModel(dm);
           //TablaInsumoUso.setEnabled(false);

        } catch (IOException ex) {
            Logger.getLogger(Insumo_Inventarios.class.getName()).log(Level.SEVERE, null, ex);
        } catch (SQLException ex) {
            Logger.getLogger(Insumo_Inventarios.class.getName()).log(Level.SEVERE, null, ex);
        }

    }//GEN-LAST:event_MostrarInsumoUsoActionPerformed

    private void diaInsumoActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_diaInsumoActionPerformed
        // TODO add your handling code here:
}//GEN-LAST:event_diaInsumoActionPerformed

    private void diaInsumo1ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_diaInsumo1ActionPerformed
        // TODO add your handling code here:
    }//GEN-LAST:event_diaInsumo1ActionPerformed

    private void ConsultarActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_ConsultarActionPerformed
        try {

//            Date fecha = null;
//
//            String dia = diaEvento.getSelectedItem().toString();
//            //System.out.println(mesEvento.getMonth()+1);
//            String mes = String.valueOf(mesEvento.getMonth()+1);
//            int ano = anoEvento.getYear();
//            String anho = String.valueOf(ano);
//            String time = anho+"-"+mes+"-"+dia;
//
//            fecha = Date.valueOf(time);
            // TODO add your handling code here:
            control_evento = new ControlEvento();
            List<Evento> evento = control_evento.consultarEventos();

            for(int i=0; i<evento.size();i++){
//                if(evento.get(i).getFecha().equals(fecha))
                //String elemento = evento.get(i).getIdEvento().toString()+", "+evento.get(i).getDescripcion();
                EventoConsulta.addItem(evento.get(i).getIdEvento()+", "+evento.get(i).getDescripcion());
            }







            // TODO add your handling code here:
            control_categoria = new ControlCategoria();
            List<Categoria> categorias = control_categoria.consultarCategoria();

            for (int i=0; i<categorias.size();i++){
                CategoriaInsumoEvento.addItem(categorias.get(i).getNombre());
            }





        } catch (IOException ex) {
            Logger.getLogger(Insumo_Inventarios.class.getName()).log(Level.SEVERE, null, ex);
        } catch (SQLException ex) {
            Logger.getLogger(Insumo_Inventarios.class.getName()).log(Level.SEVERE, null, ex);
        }

}//GEN-LAST:event_ConsultarActionPerformed

    private void EventoConsultaActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_EventoConsultaActionPerformed
        // TODO add your handling code here:


        try {
           
            String elemento = EventoConsulta.getSelectedItem().toString();
            String[] id1 = elemento.split(", ");
            Integer id = Integer.parseInt(id1[0]);
            control_evento = new ControlEvento();
            List<Evento> evento = control_evento.consultarEventos();

            for (int i=0; i<evento.size();i++){
                if(evento.get(i).getIdEvento().equals(id)){
                    FechaEventoConsulta.setText(evento.get(i).getFecha().toString());
                    HoraIConsulta.setText(evento.get(i).getHoraInicio().toString());
                    HoraFConsulta.setText(evento.get(i).getHoraFin().toString());
                    //DescripcionEventoConsulta.setText(evento.get(i).getDescripcion());
                }
            }
            //this.CategoriaInsumoEvento.doLayout();
            //CategoriaInsumoEvento.setEnabled(true);

        } catch (IOException ex) {
            Logger.getLogger(Insumo_Inventarios.class.getName()).log(Level.SEVERE, null, ex);
        } catch (SQLException ex) {
            Logger.getLogger(Insumo_Inventarios.class.getName()).log(Level.SEVERE, null, ex);
        }


    }//GEN-LAST:event_EventoConsultaActionPerformed

    private void CategoriaInsumoEventoActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_CategoriaInsumoEventoActionPerformed
        try {
            DefaultTableModel dm =  new DefaultTableModel();
            dm.addColumn("Concepto");
            dm.addColumn("Cantidad");
            dm.addColumn("Costo Unitario");
            dm.addColumn("Monto");







            //if(EventoConsulta.getItemCount()>=1){
            control_categoria = new ControlCategoria();
            List<Categoria> categoria = control_categoria.consultarCategoria();
            control_insumo = new ControlInsumo();
            List<Insumo> insumos = control_insumo.consultarInsumo();
            String categ = CategoriaInsumoEvento.getSelectedItem().toString();
            control_InsumoInventario = new ControlInsumoInventario();
            List<InsumoInventario> insumo_inventario = control_InsumoInventario.consultarInsumoInventario();
            control_uso = new ControlUso();
            List<Uso> usos = control_uso.consultarUso();
            control_evento = new ControlEvento();
            List<Evento> eventos = control_evento.consultarEventos();

            String elemento = EventoConsulta.getSelectedItem().toString();
            String[] id = elemento.split(", ");
            Integer idEvento = Integer.parseInt(id[0]);
            int cant =0;
            double monto=0.0;
            double costo=0.0;




            for (int i=0;i<categoria.size();i++){
                if(categoria.get(i).getNombre().equals(categ)){
                    for(int j=0;j<insumos.size();j++){
                        if(categoria.get(i).getidCATEGORIA().equals(insumos.get(j).getidCATEGORIA())){
                             Vector ve = new Vector();
                            for(int k=0;k<usos.size();k++){
                                if ((insumos.get(j).getIdINSUMO().equals(usos.get(k).getINSUMO_idINSUMO())) && (usos.get(k).getEVENTO_idEVENTO().equals(idEvento))) {
                                    //System.out.println("concepto: "+insumos.get(j).getConcepto());
                                    //System.out.println("cantidad: "+usos.get(k).getCantidad());
                                    ve.addElement(insumos.get(j).getConcepto());
                                     ve.addElement(usos.get(k).getCantidad());
                                     cant = usos.get(k).getCantidad();
                                     
                                     for(int m=0;m<insumo_inventario.size();m++){
                                if(insumo_inventario.get(m).getINSUMO_idINSUMO().equals(insumos.get(j).getIdINSUMO())){
                                    //System.out.println(insumo_inventario.get(m).getCostoUnitario());
                                    costo=insumo_inventario.get(m).getCostoUnitario();
                                    monto = costo*cant;
                                    //System.out.println("costo:"+insumo_inventario.get(m).getCostoUnitario());
                                    //System.out.println("monto: "+monto);
                                    ve.addElement(insumo_inventario.get(m).getCostoUnitario());
                                    ve.addElement(monto);
                                    dm.addRow(ve);

                                    
                                }
                            }

//                                    for (int m = 0; m < insumo_inventario.size(); m++) {
//                                        if (insumo_inventario.get(m).getINSUMO_idINSUMO().equals(insumos.get(j).getIdINSUMO())) {
//                                    System.out.println(insumo_inventario.get(m).getCantidad());
//                                    //ve.addElement(insumo_inventario.get(m).getCantidad());
//                                }
//
//                                    //v.addElement(insumos.get(j).getConcepto());
                               }
                            }

                            

                        }
                    }
                }
            }
             if(dm.getRowCount()==0)
                JOptionPane.showMessageDialog(aviso, "No hay Insumos en esta categoria");


            TablaEventoInsumo.setModel(dm);
            TablaEventoInsumo.setEnabled(false);


//            for (int i=0;i<categoria.size();i++){
//               if(categoria.get(i).getNombre().equals(categ)){
//
//               }
//            }
            //}
        } catch (IOException ex) {
            Logger.getLogger(Insumo_Inventarios.class.getName()).log(Level.SEVERE, null, ex);
        } catch (SQLException ex) {
            Logger.getLogger(Insumo_Inventarios.class.getName()).log(Level.SEVERE, null, ex);
        }


    }//GEN-LAST:event_CategoriaInsumoEventoActionPerformed

    private void CategoriaInsumoEventoAncestorAdded(javax.swing.event.AncestorEvent evt) {//GEN-FIRST:event_CategoriaInsumoEventoAncestorAdded
        // TODO add your handling code here:
    }//GEN-LAST:event_CategoriaInsumoEventoAncestorAdded

    private void Tabla_CategoriasMouseClicked(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_Tabla_CategoriasMouseClicked
        Integer rowSelectedCategoria = Tabla_Categorias.getSelectedRow();

        String idCategorias = Tabla_Categorias.getValueAt(rowSelectedCategoria, 0).toString();
        idCategoria.setText(idCategorias);
        idCategoria1.setText(idCategorias);
        String nombre = Tabla_Categorias.getValueAt(rowSelectedCategoria, 1).toString();
        NombreCategoria2.setText(nombre);
        NombreCategoria3.setText(nombre);
    }//GEN-LAST:event_Tabla_CategoriasMouseClicked

    private void Tabla_InsumosMouseClicked(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_Tabla_InsumosMouseClicked
        // TODO add your handling code here:
        Integer rowSelectedInsumo = Tabla_Insumos.getSelectedRow();

        String idInsumos = Tabla_Insumos.getValueAt(rowSelectedInsumo, 0).toString();

        idInsumo.setText(idInsumos);
        idInsumo1.setText(idInsumos);
        NombreInsumo2.setText(Tabla_Insumos.getValueAt(rowSelectedInsumo, 1).toString());
        NombreInsumo3.setText(Tabla_Insumos.getValueAt(rowSelectedInsumo, 1).toString());
        CantidadInsumoModificar.setText(Tabla_Insumos.getValueAt(rowSelectedInsumo, 3).toString());
        CostoInsumoModificar.setText(Tabla_Insumos.getValueAt(rowSelectedInsumo, 4).toString());



        

    }//GEN-LAST:event_Tabla_InsumosMouseClicked

    private void TablaInsumoUsoMouseClicked(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_TablaInsumoUsoMouseClicked
        try {
            // TODO add your handling code here:
            Integer rowSelectedUso = TablaInsumoUso.getSelectedRow();
            String idUso = TablaInsumoUso.getValueAt(rowSelectedUso, 0).toString();
            String concepto = TablaInsumoUso.getValueAt(rowSelectedUso, 1).toString();

            Integer id =Integer.parseInt(idUso);

            IdInsumoUso.setText(idUso);
            ConceptoInsumoUso.setText(concepto);

            control_insumo = new ControlInsumo();

            List<Insumo> insumos = control_insumo.consultarInsumo();

            control_categoria = new ControlCategoria();
            List<Categoria> categorias = control_categoria.consultarCategoria();

            for (int i =0; i<insumos.size();i++){
                if(insumos.get(i).getIdINSUMO().equals(id)){
                    for(int j=0; j<categorias.size();j++){
                        if(categorias.get(j).getidCATEGORIA().equals(insumos.get(i).getidCATEGORIA())){
                            CategoriaInsumoUso.setText(categorias.get(j).getNombre());
                        }
                    }
                }
            }
        } catch (IOException ex) {
            Logger.getLogger(Insumo_Inventarios.class.getName()).log(Level.SEVERE, null, ex);
        } catch (SQLException ex) {
            Logger.getLogger(Insumo_Inventarios.class.getName()).log(Level.SEVERE, null, ex);
        }

        




    }//GEN-LAST:event_TablaInsumoUsoMouseClicked

    private void TablaInsumoDisponibleMouseClicked(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_TablaInsumoDisponibleMouseClicked
        // TODO add your handling code here:
        try{
        Integer rowSelectedUso = TablaInsumoDisponible.getSelectedRow();
            String idUso = TablaInsumoDisponible.getValueAt(rowSelectedUso, 0).toString();
        String concepto = TablaInsumoDisponible.getValueAt(rowSelectedUso, 1).toString();

            Integer id =Integer.parseInt(idUso);

            IdInsumoDisponible.setText(idUso);
            ConceptoInsumoDisponible.setText(concepto);

            control_insumo = new ControlInsumo();

            List<Insumo> insumos = control_insumo.consultarInsumo();

            control_categoria = new ControlCategoria();
            List<Categoria> categorias = control_categoria.consultarCategoria();

            for (int i =0; i<insumos.size();i++){
                if(insumos.get(i).getIdINSUMO().equals(id)){
                    for(int j=0; j<categorias.size();j++){
                        if(categorias.get(j).getidCATEGORIA().equals(insumos.get(i).getidCATEGORIA())){
                            CategoriaInsumoDisponible.setText(categorias.get(j).getNombre());
                        }
                    }
                }
            }
        } catch (IOException ex) {
            Logger.getLogger(Insumo_Inventarios.class.getName()).log(Level.SEVERE, null, ex);
        } catch (SQLException ex) {
            Logger.getLogger(Insumo_Inventarios.class.getName()).log(Level.SEVERE, null, ex);
        }

    }//GEN-LAST:event_TablaInsumoDisponibleMouseClicked

    private void jMenuItem2ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jMenuItem2ActionPerformed
        cancelacionEvento ce = new cancelacionEvento();
        ce.setVisible(true);
}//GEN-LAST:event_jMenuItem2ActionPerformed

    private void cargarTablaCategorias(List<Categoria> categorias){

        DefaultTableModel dm =  new DefaultTableModel();

            dm.addColumn("Id");
            dm.addColumn("nombre");
           



            for (int i=0;i<categorias.size();i++){
                Vector eje = new Vector();
                eje.addElement(categorias.get(i).getidCATEGORIA());
                eje.addElement(categorias.get(i).getNombre());


                dm.addRow(eje);
            }
            Tabla_Categorias.setModel(dm);
            //Tabla_Categorias.setEnabled(false);
    }

    private void cargarTablaInsumos(List<Insumo> insumos, List<Categoria> categorias, List<InsumoInventario> insumo_inventario){

        DefaultTableModel dm =  new DefaultTableModel();

            dm.addColumn("Id");
            dm.addColumn("Concepto");
            dm.addColumn("Categoria");
            dm.addColumn("Cantidad");
            dm.addColumn("Costo Unitario");
           
            

            for (int i=0;i<insumos.size();i++){
                Vector cont = new Vector();
                cont.addElement(insumos.get(i).getIdINSUMO());
                cont.addElement(insumos.get(i).getConcepto());

                for (int j = 0; j < categorias.size(); j++) {



                if (insumos.get(i).getidCATEGORIA().equals(categorias.get(j).getidCATEGORIA())) {
                    cont.addElement(categorias.get(j).getNombre());

//                    for (int k = 0; k < insumo_inventario.size(); k++) {
//                        if (insumos.get(i).getIdINSUMO() == insumo_inventario.get(k).getINSUMO_idINSUMO()) {
//                            cont.addElement(insumo_inventario.get(k).getCantidad());
//                            cont.addElement(insumo_inventario.get(k).getCostoUnitario());
//                        }
//                    }
                }

                


                
            }
                
                for(int k=0; k<insumo_inventario.size();k++){
                    if(insumos.get(i).getIdINSUMO().equals(insumo_inventario.get(k).getINSUMO_idINSUMO())){
                        cont.addElement(insumo_inventario.get(k).getCantidad());
                        cont.addElement(insumo_inventario.get(k).getCostoUnitario());
                    }
                }
               dm.addRow(cont);

        }
        Tabla_Insumos.setModel(dm);
        //Tabla_Insumos.setEnabled(false);
            }
    

    private void cargarTablaCotizaciones(List<Cotizacion> cotizaciones){

        DefaultTableModel dm =  new DefaultTableModel();

            dm.addColumn("Id");
            dm.addColumn("Estatus");
            dm.addColumn("Fecha");
            dm.addColumn("Color");
            dm.addColumn("Id Evento");
            dm.addColumn("Rif Cliente Compania");
            dm.addColumn("Cedula Cliente Particular");

            for (int i=0;i<cotizaciones.size();i++){
                Vector cot = new Vector();
                cot.addElement(cotizaciones.get(i).getIdCotizacion());
                cot.addElement(cotizaciones.get(i).getEstatus());
                cot.addElement(cotizaciones.get(i).getFecha());
                cot.addElement(cotizaciones.get(i).getColor());
                cot.addElement(cotizaciones.get(i).getEventoIdEvento());
                if(cotizaciones.get(i).getClienteCompaniaRif().equals("")){
                    cot.addElement("--");
                }else{
                    cot.addElement(cotizaciones.get(i).getClienteCompaniaRif());
                }
                if(cotizaciones.get(i).getClienteParticularCedula().equals(0)){
                    cot.addElement("--");
                }else{
                    cot.addElement(cotizaciones.get(i).getClienteParticularCedula());
                }

                dm.addRow(cot);
            }
            //tablaCotizaciones.setModel(dm);
    }

    private void cargarTablaParticulares(List<ClienteParticular> particulares){

        DefaultTableModel dm =  new DefaultTableModel();

            dm.addColumn("Cedula");
            dm.addColumn("Nombre");
            dm.addColumn("Apellido");
            dm.addColumn("Direccion");
            dm.addColumn("Telefono");

            for (int i=0;i<particulares.size();i++){
                Vector part = new Vector();
                part.addElement(particulares.get(i).getCedula());
                part.addElement(particulares.get(i).getNombre());
                part.addElement(particulares.get(i).getApellido());
                part.addElement(particulares.get(i).getDireccion());
                part.addElement(particulares.get(i).getTelefono());

                dm.addRow(part);
            }
           // tablaParticulares.setModel(dm);
    }

    private void cargarTablaCompanias(List<ClienteCompania> companias){

        DefaultTableModel dm =  new DefaultTableModel();

            dm.addColumn("Rif");
            dm.addColumn("Nombre");
            dm.addColumn("Direccion");
            dm.addColumn("Telefono");

            for (int i=0;i<companias.size();i++){
                Vector comp = new Vector();
                comp.addElement(companias.get(i).getRif());
                comp.addElement(companias.get(i).getNombre());
                comp.addElement(companias.get(i).getDireccion());
                comp.addElement(companias.get(i).getTelefono());

                dm.addRow(comp);
            }
           // tablaCompanias.setModel(dm);
    }

    private void cargarTablaAtencionPart(List<EmpleadoClientePart> clientePart){

        DefaultTableModel dm =  new DefaultTableModel();

            dm.addColumn("Cedula Cliente Particular");
            dm.addColumn("Cedula Ejecutivo");

            for (int i=0;i<clientePart.size();i++){
                Vector cli = new Vector();
                cli.addElement(clientePart.get(i).getClienteParticularCedula());
                cli.addElement(clientePart.get(i).getEjecutivoCedula());

                dm.addRow(cli);
            }
           // tablaAtencionPart.setModel(dm);
    }

    private void cargarTablaAtencionComp(List<EmpleadoClienteComp> clienteComp){

        DefaultTableModel dm =  new DefaultTableModel();

            dm.addColumn("Rif Cliente Compania");
            dm.addColumn("Cedula Ejecutivo");

            for (int i=0;i<clienteComp.size();i++){
                Vector cli = new Vector();
                cli.addElement(clienteComp.get(i).getClienteCompaniaRif());
                cli.addElement(clienteComp.get(i).getEjecutivoCedula());

                dm.addRow(cli);
            }
           // tablaAtencionComp.setModel(dm);
    }

//    private void cargarCedulasEjecutivos(){
//
//        cedulas.setVisible(false);
//        if(cedulas.isPopupVisible()!=true){
//           cedulas.removeAllItems();
//        }
//        cedulas2.setVisible(false);
//        if(cedulas2.isPopupVisible()!=true){
//           cedulas2.removeAllItems();
//        }
//            try {
//                controlEmpleado = new ControlEmpleado();
//                List<Empleado> ejecutivos = controlEmpleado.consultarEjecutivos();
//                    for (int i=0;i<ejecutivos.size();i++){
//                        Integer Cedula = ejecutivos.get(i).getCedula();
//                        cedulas.addItem(Cedula);
//                        cedulas2.addItem(Cedula);
//                        }
//            } catch (IOException ex) {
//                Logger.getLogger(Insumo_Inventarios.class.getName()).log(Level.SEVERE, null, ex);
//            } catch (SQLException ex) {
//                Logger.getLogger(Insumo_Inventarios.class.getName()).log(Level.SEVERE, null, ex);
//            }
//        cedulas.setVisible(true);
//        cedulas2.setVisible(true);
//}

//    private void cargarCedulasEjecutivosPart(){
//
//        cedulasEjecutivosPart.setVisible(false);
//        if(cedulasEjecutivosPart.isPopupVisible()!=true){
//           cedulasEjecutivosPart.removeAllItems();
//        }
//            try {
//                controlEmpleado = new ControlEmpleado();
//                List<Empleado> ejecutivos = controlEmpleado.consultarEjecutivos();
//                    for (int i=0;i<ejecutivos.size();i++){
//                        Integer Cedula = ejecutivos.get(i).getCedula();
//                        cedulasEjecutivosPart.addItem(Cedula);
//                        }
//            } catch (IOException ex) {
//                Logger.getLogger(Insumo_Inventarios.class.getName()).log(Level.SEVERE, null, ex);
//            } catch (SQLException ex) {
//                Logger.getLogger(Insumo_Inventarios.class.getName()).log(Level.SEVERE, null, ex);
//            }
//        cedulasEjecutivosPart.setVisible(true);
//}

//    private void cargarIdEventoCot(){
//
//        idEventoCot.setVisible(false);
//        if(idEventoCot.isPopupVisible()!=true){
//           idEventoCot.removeAllItems();
//        }
//            try {
//                controlEvento = new ControlEvento();
//                List<Evento> eventos = controlEvento.consultarEventos();
//                    for (int i=0;i<eventos.size();i++){
//                        Integer Id = eventos.get(i).getIdEvento();
//                        idEventoCot.addItem(Id);
//                        }
//            } catch (IOException ex) {
//                Logger.getLogger(Insumo_Inventarios.class.getName()).log(Level.SEVERE, null, ex);
//            } catch (SQLException ex) {
//                Logger.getLogger(Insumo_Inventarios.class.getName()).log(Level.SEVERE, null, ex);
//            }
//        idEventoCot.setVisible(true);
//}
//
    
    private void CargarInsumosNuevos(List<InsumoInventario> InsumoInventario, List<Insumo> insumo)
    {
//        IdInsumoInventario.setVisible(false);
//        if(IdInsumoInventario.isPopupVisible()!=true){
//            IdInsumoInventario.removeAllItems();
//        }
//       List id=null;
//
//       for (int i=0; i<InsumoInventario.size();i++){
//           id.add(InsumoInventario.get(i).getINSUMO_idINSUMO());
//       }


      
    }
    private void cargarIdCategorias(){

//         IdCategoria.setVisible(false);
//        if(IdCategoria.isPopupVisible()!=true){
//           IdCategoria.removeAllItems();
//        }
//        IdCategoria2.setVisible(false);
//        if(IdCategoria2.isPopupVisible()!=true){
//           IdCategoria2.removeAllItems();
//        }
//            try {
//                control_categoria = new ControlCategoria();
//                List<Categoria> categorias = control_categoria.consultarCategoria();
//                    for (int i=0;i<categorias.size();i++){
//                        Integer Id = categorias.get(i).getidCATEGORIA();
//                        IdCategoria.addItem(Id);
//                        IdCategoria2.addItem(Id);
//                        }
//            } catch (IOException ex) {
//                Logger.getLogger(InformacionSistema.class.getName()).log(Level.SEVERE, null, ex);
//            } catch (SQLException ex) {
//                Logger.getLogger(InformacionSistema.class.getName()).log(Level.SEVERE, null, ex);
//            }
//        IdCategoria.setVisible(true);
//        IdCategoria2.setVisible(true);
}

    private void cargarIdCategorias_Insumos(){

//         Categorias.setVisible(false);
//        if(Categorias.isPopupVisible()!=true){
//           Categorias.removeAllItems();
//        }
         CategoriaModificar.setVisible(false);
         if (CategoriaModificar.isPopupVisible()!=true){
             CategoriaModificar.removeAllItems();
         }


        
        
            try {
                control_categoria = new ControlCategoria();
                List<Categoria> categorias = control_categoria.consultarCategoria();
                    for (int i=0;i<categorias.size();i++){
                        String nombre = categorias.get(i).getNombre();
                        //Categorias.addItem(nombre);
                        CategoriaModificar.addItem(nombre);
                       
                        
                        }
            } catch (IOException ex) {
                Logger.getLogger(InformacionSistema.class.getName()).log(Level.SEVERE, null, ex);
            } catch (SQLException ex) {
                Logger.getLogger(InformacionSistema.class.getName()).log(Level.SEVERE, null, ex);
            }
        Categorias.setVisible(true);
        CategoriaModificar.setVisible(true);
       
      
}

     private void cargarIdInsumos(){

//         IdInsumo.setVisible(false);
//        if(IdInsumo.isPopupVisible()!=true){
//           IdInsumo.removeAllItems();
//        }
//        IdInsumo2.setVisible(false);
//        if(IdInsumo2.isPopupVisible()!=true){
//           IdInsumo2.removeAllItems();
//        }
//            try {
//
//                control_insumo = new ControlInsumo();
//                List<Insumo> insumos = control_insumo.consultarInsumo();
//
//
//
//
//                for (int j=0;j<insumos.size();j++){
//
//                        IdInsumo.addItem(insumos.get(j).getIdINSUMO());
//                        IdInsumo2.addItem(insumos.get(j).getIdINSUMO());
//
//                }
//            } catch (IOException ex) {
//                Logger.getLogger(InformacionSistema.class.getName()).log(Level.SEVERE, null, ex);
//            } catch (SQLException ex) {
//                Logger.getLogger(InformacionSistema.class.getName()).log(Level.SEVERE, null, ex);
//            }
//        IdInsumo.setVisible(true);
//        IdInsumo2.setVisible(true);
}


//
//    private void cargarCedulasEjecutivosEvento(){
//
//        cedulaEvento.setVisible(false);
//        if(cedulaEvento.isPopupVisible()!=true){
//           cedulaEvento.removeAllItems();
//        }
//        cedulaEjec2.setVisible(false);
//        if(cedulaEjec2.isPopupVisible()!=true){
//           cedulaEjec2.removeAllItems();
//        }
//            try {
//                controlEmpleado = new ControlEmpleado();
//                List<Empleado> ejecutivos = controlEmpleado.consultarEjecutivos();
//                    for (int i=0;i<ejecutivos.size();i++){
//                        Integer Cedula = ejecutivos.get(i).getCedula();
//                        cedulaEvento.addItem(Cedula);
//                        cedulaEjec2.addItem(Cedula);
//                        }
//            } catch (IOException ex) {
//                Logger.getLogger(Insumo_Inventarios.class.getName()).log(Level.SEVERE, null, ex);
//            } catch (SQLException ex) {
//                Logger.getLogger(Insumo_Inventarios.class.getName()).log(Level.SEVERE, null, ex);
//            }
//        cedulaEvento.setVisible(true);
//        cedulaEjec2.setVisible(true);
//}
//
//    private void cargarIdEventos(){
//
//        idEventos.setVisible(false);
//        if(idEventos.isPopupVisible()!=true){
//           idEventos.removeAllItems();
//        }
//        idEventos2.setVisible(false);
//        if(idEventos2.isPopupVisible()!=true){
//           idEventos2.removeAllItems();
//        }
//            try {
//                controlEvento = new ControlEvento();
//                List<Evento> eventos = controlEvento.consultarEventos();
//                    for (int i=0;i<eventos.size();i++){
//                        Integer id = eventos.get(i).getIdEvento();
//                        idEventos.addItem(id);
//                        idEventos2.addItem(id);
//                        }
//            } catch (IOException ex) {
//                Logger.getLogger(Insumo_Inventarios.class.getName()).log(Level.SEVERE, null, ex);
//            } catch (SQLException ex) {
//                Logger.getLogger(Insumo_Inventarios.class.getName()).log(Level.SEVERE, null, ex);
//            }
//        idEventos.setVisible(true);
//        idEventos2.setVisible(true);
//}
//
    private void asignarLabelCategorias(List<Categoria> categorias){

//        if(IdCategoria.getItemCount()!=0){
//            Integer id = Integer.parseInt(IdCategoria.getSelectedItem().toString());
//
//
//            for (int i=0;i<categorias.size();i++){
//
//                if(categorias.get(i).getidCATEGORIA()==id.intValue()){
//                    NombreCategoria2.setText(categorias.get(i).getNombre());
//
//                }
//            }
//       }
}

private void asignarLabelInsumos(List<Insumo> insumos){

//        if(IdInsumo.getItemCount()!=0){
//            Integer id = Integer.parseInt(IdInsumo.getSelectedItem().toString());
//
//
//            for (int i=0;i<insumos.size();i++){
//
//                if(insumos.get(i).getIdINSUMO()==id.intValue()){
//                    NombreInsumo2.setText(insumos.get(i).getConcepto());
//
//                }
//            }
//       }
}
//
//    private void asignarEtiquetaEjecutivo(List<Empleado> ejecutivos){
//        if(cedulasEjecutivosPart.getItemCount()!=0){
//            Integer Cedula = Integer.parseInt(cedulasEjecutivosPart.getSelectedItem().toString());
//
//            for (int i=0;i<ejecutivos.size();i++){
//                if(ejecutivos.get(i).getCedula().equals(Cedula)){
//                    cedulasEjecutivosPart.setToolTipText(ejecutivos.get(i).getNombre()+" "+ejecutivos.get(i).getApellido());
//                }
//            }
//       }
//}
//
//    private void asignarEtiquetaEjecutivoComp(List<Empleado> ejecutivos){
//        if(cedulasEjecutivosComp.getItemCount()!=0){
//            Integer Cedula = Integer.parseInt(cedulasEjecutivosComp.getSelectedItem().toString());
//
//            for (int i=0;i<ejecutivos.size();i++){
//                if(ejecutivos.get(i).getCedula().equals(Cedula)){
//                    cedulasEjecutivosComp.setToolTipText(ejecutivos.get(i).getNombre()+" "+ejecutivos.get(i).getApellido());
//                }
//            }
//       }
//}
//
//    private void asignarEtiquetaEvento(List<Evento> eventos){
//        if(idEventoCot.getItemCount()!=0){
//            Integer Id = Integer.parseInt(idEventoCot.getSelectedItem().toString());
//
//            for (int i=0;i<eventos.size();i++){
//                if(eventos.get(i).getIdEvento().equals(Id)){
//                    idEventoCot.setToolTipText(eventos.get(i).getDescripcion()+" "+eventos.get(i).getFecha().toString());
//                }
//            }
//       }
//}

//    private void asignarEtiquetaClienteComp(List<ClienteCompania> companias){
//        if(rifCompaniaCot.getItemCount()!=0){
//            String Rif = rifCompaniaCot.getSelectedItem().toString();
//
//            for (int i=0;i<companias.size();i++){
//                if(companias.get(i).getRif().equals(Rif)){
//                    rifCompaniaCot.setToolTipText(companias.get(i).getNombre());
//                }
//            }
//       }
//}
//
//    private void asignarEtiquetaClientePart(List<ClienteParticular> particulares){
//        if(cedulaParticularCot.getItemCount()!=0){
//            Integer Cedula = Integer.parseInt(cedulaParticularCot.getSelectedItem().toString());
//
//            for (int i=0;i<particulares.size();i++){
//                if(particulares.get(i).getCedula().equals(Cedula)){
//                    cedulaParticularCot.setToolTipText(particulares.get(i).getNombre()+" "+particulares.get(i).getApellido());
//                }
//            }
//       }
//}
//
//    private void asignarLabelContratado(List<Empleado>contratados){
//
//        if(cedulasC.getItemCount()!=0){
//           Integer Cedula = Integer.parseInt(cedulasC.getSelectedItem().toString());
//
//           for (int i=0;i<contratados.size();i++){
//
//               if(contratados.get(i).getCedula().equals(Cedula)){
//                   nombreContratado.setText(contratados.get(i).getNombre());
//                   apellidoContratado.setText(contratados.get(i).getApellido());
//                   telefonoContratado.setText(contratados.get(i).getTelefono());
//                   cargoContratado.setText(contratados.get(i).getCargoContratado());
//                   costoContratado.setText(Double.toString(contratados.get(i).getCostoHoraContratado()));
//               }
//            }
//        }
//}
//
//    private void asignarLabelParticulares(List<ClienteParticular> particulares){
//
//        if(cedulasParticulares.getItemCount()!=0){
//            Integer Cedula = Integer.parseInt(cedulasParticulares.getSelectedItem().toString());
//
//            for (int i=0;i<particulares.size();i++){
//
//                if(particulares.get(i).getCedula().equals(Cedula)){
//                    nombrePartLabel.setText(particulares.get(i).getNombre());
//                    apellidoPartLabel.setText(particulares.get(i).getApellido());
//                    direccionPartLabel.setText(particulares.get(i).getDireccion());
//                    telefonoPartLabel.setText(particulares.get(i).getTelefono());
//                }
//            }
//       }
//}
//
//    private void asignarLabelCompanias(List<ClienteCompania> companias){
//
//        if(rifsCompanias.getItemCount()!=0){
//            String Rif = rifsCompanias.getSelectedItem().toString();
//
//            for (int i=0;i<companias.size();i++){
//
//                if(companias.get(i).getRif().equals(Rif)){
//                    nombreCompLabel.setText(companias.get(i).getNombre());
//                    direccionComp.setText(companias.get(i).getDireccion());
//                    telefonoCompLabel.setText(companias.get(i).getTelefono());
//                }
//            }
//       }
//}
//
//private void asignarLabelEventos(List<Evento> eventos){
//
//    if(idEventos.getItemCount()!=0){
//       Integer id = Integer.parseInt(idEventos.getSelectedItem().toString());
//
//       for (int i=0;i<eventos.size();i++){
//
//           if(eventos.get(i).getIdEvento().equals(id)){
//               fechaLabel.setText(eventos.get(i).getFecha().toString());
//               descripcionLabel.setText(eventos.get(i).getDescripcion());
//               horaInicioLabel.setText(eventos.get(i).getHoraInicio().toString());
//               horaFinLabel.setText(eventos.get(i).getHoraFin().toString());
//               cedEventoLabel.setText(eventos.get(i).getEjecutivoCedula().toString());
//           }
//        }
//    }
//}
//
//private void asignarLabelCotizaciones(List<Cotizacion> cotizaciones){
//
//    if(idsCotizaciones.getItemCount()!=0){
//       Integer id = Integer.parseInt(idsCotizaciones.getSelectedItem().toString());
//
//       for (int i=0;i<cotizaciones.size();i++){
//
//           if(cotizaciones.get(i).getIdCotizacion().equals(id)){
//               if(cotizaciones.get(i).getEstatus().equals("I")){
//                   estatusCotLabel.setText("Inicial");
//               }
//               if(cotizaciones.get(i).getEstatus().equals("A")){
//                   estatusCotLabel.setText("Aprobado");
//               }
//               if(cotizaciones.get(i).getEstatus().equals("R")){
//                   estatusCotLabel.setText("Rechazado");
//               }
//               fechaCotLabel.setText(cotizaciones.get(i).getFecha().toString());
//               colorCotLabel.setText(cotizaciones.get(i).getColor());
//               idEventoCotLabel.setText(cotizaciones.get(i).getEventoIdEvento().toString());
//               if(cotizaciones.get(i).getClienteCompaniaRif().equals("")){
//                   rifCompCotLabel.setText("--");
//               }else{
//                    rifCompCotLabel.setText(cotizaciones.get(i).getClienteCompaniaRif());
//               }
//               if(cotizaciones.get(i).getClienteParticularCedula().equals(0)){
//                   cedPartCotLabel.setText("--");
//               }else{
//                   cedPartCotLabel.setText(cotizaciones.get(i).getClienteParticularCedula().toString());
//               }
//           }
//        }
//    }
//}
//
//private void cargarCedulasContratados(){
//    cedulasC.setVisible(false);
//    if(cedulasC.isPopupVisible()!=true){
//            cedulasC.removeAllItems();
//    }
//    cedulasC2.setVisible(false);
//    if(cedulasC2.isPopupVisible()!=true){
//            cedulasC2.removeAllItems();
//    }
//        try {
//            controlEmpleado = new ControlEmpleado();
//            List<Empleado> contratados = controlEmpleado.consultarContratados();
//                for (int i=0;i<contratados.size();i++){
//                    Integer Cedula = contratados.get(i).getCedula();
//                    cedulasC.addItem(Cedula);
//                    cedulasC2.addItem(Cedula);
//                    }
//        } catch (IOException ex) {
//            Logger.getLogger(Insumo_Inventarios.class.getName()).log(Level.SEVERE, null, ex);
//        } catch (SQLException ex) {
//            Logger.getLogger(Insumo_Inventarios.class.getName()).log(Level.SEVERE, null, ex);
//        }
//    cedulasC.setVisible(true);
//    cedulasC2.setVisible(true);
//}
//
//private void cargarCedulasParticulares(){
//
//    cedulasParticulares.setVisible(false);
//    if(cedulasParticulares.isPopupVisible()!=true){
//            cedulasParticulares.removeAllItems();
//    }
//    cedulasParticulares2.setVisible(false);
//    if(cedulasParticulares2.isPopupVisible()!=true){
//            cedulasParticulares2.removeAllItems();
//    }
//        try {
//            controlClientePart = new ControlClienteParticular();
//            List<ClienteParticular> particulares = controlClientePart.consultarClienteParticular();
//                for (int i=0;i<particulares.size();i++){
//                    Integer Cedula = particulares.get(i).getCedula();
//                    cedulasParticulares.addItem(Cedula);
//                    cedulasParticulares2.addItem(Cedula);
//                    }
//        } catch (IOException ex) {
//            Logger.getLogger(Insumo_Inventarios.class.getName()).log(Level.SEVERE, null, ex);
//        } catch (SQLException ex) {
//            Logger.getLogger(Insumo_Inventarios.class.getName()).log(Level.SEVERE, null, ex);
//        }
//    cedulasParticulares.setVisible(true);
//    cedulasParticulares2.setVisible(true);
//}
//
//private void cargarCedulasParticularesCot(){
//
//    cedulaParticularCot.setVisible(false);
//    if(cedulaParticularCot.isPopupVisible()!=true){
//            cedulaParticularCot.removeAllItems();
//    }
//        try {
//            controlClientePart = new ControlClienteParticular();
//            List<ClienteParticular> particulares = controlClientePart.consultarClienteParticular();
//                for (int i=0;i<particulares.size();i++){
//                    Integer Cedula = particulares.get(i).getCedula();
//                    cedulaParticularCot.addItem(Cedula);
//                    }
//        } catch (IOException ex) {
//            Logger.getLogger(Insumo_Inventarios.class.getName()).log(Level.SEVERE, null, ex);
//        } catch (SQLException ex) {
//            Logger.getLogger(Insumo_Inventarios.class.getName()).log(Level.SEVERE, null, ex);
//        }
//    cedulaParticularCot.setVisible(true);
//}
//
//private void cargarRifsCompanias(){
//
//    rifsCompanias.setVisible(false);
//    if(rifsCompanias.isPopupVisible()!=true){
//            rifsCompanias.removeAllItems();
//    }
//    rifsCompanias2.setVisible(false);
//    if(rifsCompanias2.isPopupVisible()!=true){
//            rifsCompanias2.removeAllItems();
//    }
//        try {
//            controlClienteComp = new ControlClienteCompania();
//            List<ClienteCompania> companias = controlClienteComp.consultarClienteCompania();
//                for (int i=0;i<companias.size();i++){
//                    String Rif = companias.get(i).getRif();
//                    rifsCompanias.addItem(Rif);
//                    rifsCompanias2.addItem(Rif);
//                    }
//        } catch (IOException ex) {
//            Logger.getLogger(Insumo_Inventarios.class.getName()).log(Level.SEVERE, null, ex);
//        } catch (SQLException ex) {
//            Logger.getLogger(Insumo_Inventarios.class.getName()).log(Level.SEVERE, null, ex);
//        }
//    rifsCompanias.setVisible(true);
//    rifsCompanias2.setVisible(true);
//}
//
//private void cargarRifsCompaniasCot(){
//    rifCompaniaCot.setVisible(false);
//    if(rifCompaniaCot.isPopupVisible()!=true){
//            rifCompaniaCot.removeAllItems();
//    }
//
//        try {
//            controlClienteComp = new ControlClienteCompania();
//            List<ClienteCompania> companias = controlClienteComp.consultarClienteCompania();
//                for (int i=0;i<companias.size();i++){
//                    String Rif = companias.get(i).getRif();
//                    rifCompaniaCot.addItem(Rif);
//                    }
//        } catch (IOException ex) {
//            Logger.getLogger(Insumo_Inventarios.class.getName()).log(Level.SEVERE, null, ex);
//        } catch (SQLException ex) {
//            Logger.getLogger(Insumo_Inventarios.class.getName()).log(Level.SEVERE, null, ex);
//        }
//    rifCompaniaCot.setVisible(true);
//}
//
//private void cargarIdsCotizaciones(){
//
//    idsCotizaciones.setVisible(false);
//    if(idsCotizaciones.isPopupVisible()!=true){
//            idsCotizaciones.removeAllItems();
//    }
//    idsCotizaciones2.setVisible(false);
//    if(idsCotizaciones2.isPopupVisible()!=true){
//            idsCotizaciones2.removeAllItems();
//    }
//        try {
//            controlCotizacion = new ControlCotizacion();
//            List<Cotizacion> cotizaciones = controlCotizacion.consultarCotizaciones();
//                for (int i=0;i<cotizaciones.size();i++){
//                    Integer Id = cotizaciones.get(i).getIdCotizacion();
//                    idsCotizaciones.addItem(Id);
//                    idsCotizaciones2.addItem(Id);
//                    }
//        } catch (IOException ex) {
//            Logger.getLogger(Insumo_Inventarios.class.getName()).log(Level.SEVERE, null, ex);
//        } catch (SQLException ex) {
//            Logger.getLogger(Insumo_Inventarios.class.getName()).log(Level.SEVERE, null, ex);
//        }
//    idsCotizaciones.setVisible(true);
//    idsCotizaciones2.setVisible(true);
//}

    public static void main(String args[]) {
        java.awt.EventQueue.invokeLater(new Runnable() {
            public void run() {
                new Insumo_Inventarios().setVisible(true);
            }
        });
    }

    // Variables declaration - do not modify//GEN-BEGIN:variables
    private javax.swing.JTextField CantidadInsumo;
    private javax.swing.JTextField CantidadInsumoModificar;
    private javax.swing.JLabel CategoriaInsumoDisponible;
    private javax.swing.JComboBox CategoriaInsumoEvento;
    private javax.swing.JLabel CategoriaInsumoUso;
    private javax.swing.JComboBox CategoriaModificar;
    private javax.swing.JComboBox Categorias;
    private javax.swing.JCheckBox CheckCantidadInsumo;
    private javax.swing.JCheckBox CheckCategoriaInsumo;
    private javax.swing.JCheckBox CheckCostoInsumo;
    private javax.swing.JCheckBox CheckNombreCategoria;
    private javax.swing.JCheckBox CheckNombreInsumo;
    private javax.swing.JLabel ConceptoInsumoDisponible;
    private javax.swing.JLabel ConceptoInsumoUso;
    private javax.swing.JButton Consultar;
    private javax.swing.JTextField CostoInsumo;
    private javax.swing.JTextField CostoInsumoModificar;
    private javax.swing.JButton EliminarInsumo;
    private javax.swing.JComboBox EventoConsulta;
    private javax.swing.JLabel FechaEventoConsulta;
    private javax.swing.JLabel HoraFConsulta;
    private javax.swing.JLabel HoraIConsulta;
    private javax.swing.JLabel IdInsumoDisponible;
    private javax.swing.JLabel IdInsumoUso;
    private javax.swing.JButton InsertarCategoria;
    private javax.swing.JButton InsertarInsumo;
    private javax.swing.JButton ModificarCategoria;
    private javax.swing.JButton ModificarInsumo;
    private javax.swing.JButton MostrarInsumoDisponible;
    private javax.swing.JButton MostrarInsumoUso;
    private javax.swing.JButton Mostrar_Categorias;
    private javax.swing.JButton Mostrar_Insumos;
    private javax.swing.JTextField NombreCategoria;
    private javax.swing.JLabel NombreCategoria2;
    private javax.swing.JTextField NombreCategoria3;
    private javax.swing.JTextField NombreInsumo;
    private javax.swing.JLabel NombreInsumo2;
    private javax.swing.JTextField NombreInsumo3;
    private javax.swing.JTabbedPane PanelGeneral;
    private javax.swing.JPanel PanelInsumoEvento;
    private javax.swing.JTable TablaEventoInsumo;
    private javax.swing.JTable TablaInsumoDisponible;
    private javax.swing.JTable TablaInsumoUso;
    private javax.swing.JTable Tabla_Categorias;
    private javax.swing.JTable Tabla_Insumos;
    private javax.swing.JMenuItem acercaDe;
    private com.toedter.calendar.JYearChooser anoInsumo;
    private com.toedter.calendar.JYearChooser anoInsumo1;
    private javax.swing.JMenu archivo;
    private javax.swing.ButtonGroup buttonGroup1;
    private javax.swing.JComboBox diaInsumo;
    private javax.swing.JComboBox diaInsumo1;
    private javax.swing.JButton eliminarCategoria;
    private javax.swing.JMenuItem exit;
    private javax.swing.JLabel idCategoria;
    private javax.swing.JLabel idCategoria1;
    private javax.swing.JLabel idInsumo;
    private javax.swing.JLabel idInsumo1;
    private javax.swing.JMenuItem informacionSistema;
    private javax.swing.JButton jButton3;
    private javax.swing.JButton jButton5;
    private javax.swing.JLabel jLabel1;
    private javax.swing.JLabel jLabel10;
    private javax.swing.JLabel jLabel11;
    private javax.swing.JLabel jLabel12;
    private javax.swing.JLabel jLabel13;
    private javax.swing.JLabel jLabel14;
    private javax.swing.JLabel jLabel15;
    private javax.swing.JLabel jLabel16;
    private javax.swing.JLabel jLabel17;
    private javax.swing.JLabel jLabel18;
    private javax.swing.JLabel jLabel19;
    private javax.swing.JLabel jLabel2;
    private javax.swing.JLabel jLabel20;
    private javax.swing.JLabel jLabel21;
    private javax.swing.JLabel jLabel22;
    private javax.swing.JLabel jLabel23;
    private javax.swing.JLabel jLabel24;
    private javax.swing.JLabel jLabel25;
    private javax.swing.JLabel jLabel26;
    private javax.swing.JLabel jLabel27;
    private javax.swing.JLabel jLabel28;
    private javax.swing.JLabel jLabel29;
    private javax.swing.JLabel jLabel3;
    private javax.swing.JLabel jLabel30;
    private javax.swing.JLabel jLabel31;
    private javax.swing.JLabel jLabel32;
    private javax.swing.JLabel jLabel33;
    private javax.swing.JLabel jLabel34;
    private javax.swing.JLabel jLabel35;
    private javax.swing.JLabel jLabel36;
    private javax.swing.JLabel jLabel37;
    private javax.swing.JLabel jLabel38;
    private javax.swing.JLabel jLabel39;
    private javax.swing.JLabel jLabel4;
    private javax.swing.JLabel jLabel46;
    private javax.swing.JLabel jLabel47;
    private javax.swing.JLabel jLabel48;
    private javax.swing.JLabel jLabel5;
    private javax.swing.JLabel jLabel6;
    private javax.swing.JLabel jLabel7;
    private javax.swing.JLabel jLabel8;
    private javax.swing.JLabel jLabel9;
    private javax.swing.JMenu jMenu1;
    private javax.swing.JMenuBar jMenuBar1;
    private javax.swing.JMenuItem jMenuItem2;
    private javax.swing.JPanel jPanel1;
    private javax.swing.JPanel jPanel10;
    private javax.swing.JPanel jPanel11;
    private javax.swing.JPanel jPanel12;
    private javax.swing.JPanel jPanel13;
    private javax.swing.JPanel jPanel14;
    private javax.swing.JPanel jPanel15;
    private javax.swing.JPanel jPanel16;
    private javax.swing.JPanel jPanel2;
    private javax.swing.JPanel jPanel21;
    private javax.swing.JPanel jPanel3;
    private javax.swing.JPanel jPanel4;
    private javax.swing.JPanel jPanel5;
    private javax.swing.JPanel jPanel6;
    private javax.swing.JPanel jPanel7;
    private javax.swing.JPanel jPanel8;
    private javax.swing.JPanel jPanel9;
    private javax.swing.JScrollPane jScrollPane1;
    private javax.swing.JScrollPane jScrollPane2;
    private javax.swing.JScrollPane jScrollPane3;
    private javax.swing.JScrollPane jScrollPane4;
    private javax.swing.JScrollPane jScrollPane5;
    private javax.swing.JSeparator jSeparator1;
    private com.toedter.calendar.JMonthChooser mesInsumo;
    private com.toedter.calendar.JMonthChooser mesInsumo1;
    private javax.swing.JMenuItem nuevaCotizacion;
    private javax.swing.JButton salir;
    // End of variables declaration//GEN-END:variables

}
